mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
inline into
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user