X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_trait_selection%2Fsrc%2Ftraits%2Fselect%2Fcandidate_assembly.rs;h=c54d901e9b10aff43f7e9106632beef59ae3e495;hb=d67000e44e1b9908c81fc4d5de875608f1b80ae9;hp=e4b70f0d2ffa7afbfc54dbf7fdaa252400ef1226;hpb=e5a01b97ee9a3dc45d7f5055c8b0f4482b2ebad7;p=rust.git diff --git a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs index e4b70f0d2ff..c54d901e9b1 100644 --- a/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs +++ b/compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs @@ -138,7 +138,7 @@ fn assemble_candidates_from_projected_tys( // Before we go into the whole placeholder thing, just // quickly check if the self-type is a projection at all. match obligation.predicate.skip_binder().trait_ref.self_ty().kind() { - ty::Projection(_) | ty::Opaque(..) => {} + ty::Alias(..) => {} ty::Infer(ty::TyVar(_)) => { span_bug!( obligation.cause.span, @@ -394,7 +394,7 @@ fn assemble_candidates_from_auto_impls( // still be provided by a manual implementation for // this trait and type. } - ty::Param(..) | ty::Projection(..) => { + ty::Param(..) | ty::Alias(ty::Projection, ..) => { // In these cases, we don't know what the actual // type is. Therefore, we cannot break it down // into its constituent types. So we don't @@ -536,10 +536,7 @@ fn need_migrate_deref_output_trait_object( let ty = traits::normalize_projection_type( self, param_env, - ty::ProjectionTy { - item_def_id: tcx.lang_items().deref_target()?, - substs: trait_ref.substs, - }, + tcx.mk_alias_ty(tcx.lang_items().deref_target()?, trait_ref.substs), cause.clone(), 0, // We're *intentionally* throwing these away, @@ -737,13 +734,12 @@ fn assemble_const_destruct_candidates( let self_ty = self.infcx.shallow_resolve(obligation.self_ty()); match self_ty.skip_binder().kind() { - ty::Opaque(..) + ty::Alias(..) | ty::Dynamic(..) | ty::Error(_) | ty::Bound(..) | ty::Param(_) - | ty::Placeholder(_) - | ty::Projection(_) => { + | ty::Placeholder(_) => { // We don't know if these are `~const Destruct`, at least // not structurally... so don't push a candidate. } @@ -829,8 +825,7 @@ fn assemble_candidate_for_tuple( | ty::Generator(_, _, _) | ty::GeneratorWitness(_) | ty::Never - | ty::Projection(_) - | ty::Opaque(_, _) + | ty::Alias(..) | ty::Param(_) | ty::Bound(_, _) | ty::Error(_)