inline into

This commit is contained in:
Jana Dönszelmann
2026-02-09 12:31:37 +01:00
parent 6edf58fab8
commit 9aa065bc49
@@ -99,7 +99,10 @@ pub fn instantiate_ty_var<R: PredicateEmittingRelation<Self>>(
// `?1 <: ?3`.
let Generalization { value_may_be_infer: generalized_ty } = self.generalize(
relation.span(),
relation.structurally_relate_aliases().into(),
match relation.structurally_relate_aliases() {
StructurallyRelateAliases::No => GeneralizerState::Default,
StructurallyRelateAliases::Yes => GeneralizerState::StructurallyRelateAliases,
},
target_vid,
instantiation_variance,
source_ty,
@@ -236,7 +239,10 @@ pub(crate) fn instantiate_const_var<R: PredicateEmittingRelation<InferCtxt<'tcx>
// constants and generic expressions are not yet handled correctly.
let Generalization { value_may_be_infer: generalized_ct } = self.generalize(
relation.span(),
relation.structurally_relate_aliases().into(),
match relation.structurally_relate_aliases() {
StructurallyRelateAliases::No => GeneralizerState::Default,
StructurallyRelateAliases::Yes => GeneralizerState::StructurallyRelateAliases,
},
target_vid,
ty::Invariant,
source_ct,
@@ -359,15 +365,6 @@ enum GeneralizerState {
StructurallyRelateAliases,
}
impl From<StructurallyRelateAliases> for GeneralizerState {
fn from(structurally_relate_aliases: StructurallyRelateAliases) -> Self {
match structurally_relate_aliases {
StructurallyRelateAliases::No => GeneralizerState::Default,
StructurallyRelateAliases::Yes => GeneralizerState::StructurallyRelateAliases,
}
}
}
/// The "generalizer" is used when handling inference variables.
///
/// The basic strategy for handling a constraint like `?A <: B` is to