@@ -355,7 +355,7 @@ pub fn normalize_projection_type<'a, 'b, 'gcx, 'tcx>(
355355
356356 let tcx = selcx. infcx ( ) . tcx ;
357357 let def_id = tcx. associated_items ( projection_ty. trait_ref . def_id ) . find ( |i|
358- i. name == projection_ty. item_name && i. kind == ty:: AssociatedKind :: Type
358+ i. name == projection_ty. item_name ( tcx ) && i. kind == ty:: AssociatedKind :: Type
359359 ) . map ( |i| i. def_id ) . unwrap ( ) ;
360360 let ty_var = selcx. infcx ( ) . next_ty_var (
361361 TypeVariableOrigin :: NormalizeProjectionType ( tcx. def_span ( def_id) ) ) ;
@@ -436,7 +436,7 @@ fn opt_normalize_projection_type<'a, 'b, 'gcx, 'tcx>(
436436 //
437437 // ```
438438 // let ty = selcx.tcx().mk_projection(projection_ty.trait_ref,
439- // projection_ty.item_name);
439+ // projection_ty.item_name(tcx );
440440 // return Some(NormalizedTy { value: v, obligations: vec![] });
441441 // ```
442442
@@ -574,7 +574,7 @@ fn normalize_to_error<'a, 'gcx, 'tcx>(selcx: &mut SelectionContext<'a, 'gcx, 'tc
574574 predicate : trait_ref. to_predicate ( ) } ;
575575 let tcx = selcx. infcx ( ) . tcx ;
576576 let def_id = tcx. associated_items ( projection_ty. trait_ref . def_id ) . find ( |i|
577- i. name == projection_ty. item_name && i. kind == ty:: AssociatedKind :: Type
577+ i. name == projection_ty. item_name ( tcx ) && i. kind == ty:: AssociatedKind :: Type
578578 ) . map ( |i| i. def_id ) . unwrap ( ) ;
579579 let new_value = selcx. infcx ( ) . next_ty_var (
580580 TypeVariableOrigin :: NormalizeProjectionType ( tcx. def_span ( def_id) ) ) ;
@@ -729,7 +729,7 @@ fn project_type<'cx, 'gcx, 'tcx>(
729729 Ok ( ProjectedTy :: NoProgress (
730730 selcx. tcx ( ) . mk_projection (
731731 obligation. predicate . trait_ref . clone ( ) ,
732- obligation. predicate . item_name ) ) )
732+ obligation. predicate . item_name ( selcx . tcx ( ) ) ) ) )
733733 }
734734 }
735735}
@@ -815,7 +815,8 @@ fn assemble_candidates_from_predicates<'cx, 'gcx, 'tcx, I>(
815815 predicate) ;
816816 match predicate {
817817 ty:: Predicate :: Projection ( ref data) => {
818- let same_name = data. item_name ( ) == obligation. predicate . item_name ;
818+ let tcx = selcx. tcx ( ) ;
819+ let same_name = data. item_name ( tcx) == obligation. predicate . item_name ( tcx) ;
819820
820821 let is_match = same_name && infcx. probe ( |_| {
821822 let data_poly_trait_ref =
@@ -902,7 +903,7 @@ fn assemble_candidates_from_impls<'cx, 'gcx, 'tcx>(
902903 // type.
903904 let node_item = assoc_ty_def ( selcx,
904905 impl_data. impl_def_id ,
905- obligation. predicate . item_name ) ;
906+ obligation. predicate . item_name ( selcx . tcx ( ) ) ) ;
906907
907908 let is_default = if node_item. node . is_from_trait ( ) {
908909 // If true, the impl inherited a `type Foo = Bar`
@@ -1075,9 +1076,10 @@ fn confirm_object_candidate<'cx, 'gcx, 'tcx>(
10751076
10761077 // select only those projections that are actually projecting an
10771078 // item with the correct name
1079+ let tcx = selcx. tcx ( ) ;
10781080 let env_predicates = env_predicates. filter_map ( |p| match p {
10791081 ty:: Predicate :: Projection ( data) =>
1080- if data. item_name ( ) == obligation. predicate . item_name {
1082+ if data. item_name ( tcx ) == obligation. predicate . item_name ( tcx ) {
10811083 Some ( data)
10821084 } else {
10831085 None
@@ -1180,10 +1182,11 @@ fn confirm_callable_candidate<'cx, 'gcx, 'tcx>(
11801182 flag) ;
11811183
11821184 let predicate = ty:: Binder ( ty:: ProjectionPredicate { // (1) recreate binder here
1183- projection_ty : ty:: ProjectionTy {
1184- trait_ref : trait_ref,
1185- item_name : Symbol :: intern ( FN_OUTPUT_NAME ) ,
1186- } ,
1185+ projection_ty : ty:: ProjectionTy :: from_ref_and_name (
1186+ tcx,
1187+ trait_ref,
1188+ Symbol :: intern ( FN_OUTPUT_NAME ) ,
1189+ ) ,
11871190 ty : ret_type
11881191 } ) ;
11891192
@@ -1228,7 +1231,7 @@ fn confirm_impl_candidate<'cx, 'gcx, 'tcx>(
12281231 let VtableImplData { substs, nested, impl_def_id } = impl_vtable;
12291232
12301233 let tcx = selcx. tcx ( ) ;
1231- let assoc_ty = assoc_ty_def ( selcx, impl_def_id, obligation. predicate . item_name ) ;
1234+ let assoc_ty = assoc_ty_def ( selcx, impl_def_id, obligation. predicate . item_name ( tcx ) ) ;
12321235
12331236 let ty = if !assoc_ty. item . defaultness . has_value ( ) {
12341237 // This means that the impl is missing a definition for the
0 commit comments