@@ -355,7 +355,7 @@ pub fn normalize_projection_type<'a, 'b, 'gcx, 'tcx>(
355
355
356
356
let tcx = selcx. infcx ( ) . tcx ;
357
357
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
359
359
) . map ( |i| i. def_id ) . unwrap ( ) ;
360
360
let ty_var = selcx. infcx ( ) . next_ty_var (
361
361
TypeVariableOrigin :: NormalizeProjectionType ( tcx. def_span ( def_id) ) ) ;
@@ -436,7 +436,7 @@ fn opt_normalize_projection_type<'a, 'b, 'gcx, 'tcx>(
436
436
//
437
437
// ```
438
438
// let ty = selcx.tcx().mk_projection(projection_ty.trait_ref,
439
- // projection_ty.item_name);
439
+ // projection_ty.item_name(tcx );
440
440
// return Some(NormalizedTy { value: v, obligations: vec![] });
441
441
// ```
442
442
@@ -574,7 +574,7 @@ fn normalize_to_error<'a, 'gcx, 'tcx>(selcx: &mut SelectionContext<'a, 'gcx, 'tc
574
574
predicate : trait_ref. to_predicate ( ) } ;
575
575
let tcx = selcx. infcx ( ) . tcx ;
576
576
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
578
578
) . map ( |i| i. def_id ) . unwrap ( ) ;
579
579
let new_value = selcx. infcx ( ) . next_ty_var (
580
580
TypeVariableOrigin :: NormalizeProjectionType ( tcx. def_span ( def_id) ) ) ;
@@ -729,7 +729,7 @@ fn project_type<'cx, 'gcx, 'tcx>(
729
729
Ok ( ProjectedTy :: NoProgress (
730
730
selcx. tcx ( ) . mk_projection (
731
731
obligation. predicate . trait_ref . clone ( ) ,
732
- obligation. predicate . item_name ) ) )
732
+ obligation. predicate . item_name ( selcx . tcx ( ) ) ) ) )
733
733
}
734
734
}
735
735
}
@@ -815,7 +815,8 @@ fn assemble_candidates_from_predicates<'cx, 'gcx, 'tcx, I>(
815
815
predicate) ;
816
816
match predicate {
817
817
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) ;
819
820
820
821
let is_match = same_name && infcx. probe ( |_| {
821
822
let data_poly_trait_ref =
@@ -902,7 +903,7 @@ fn assemble_candidates_from_impls<'cx, 'gcx, 'tcx>(
902
903
// type.
903
904
let node_item = assoc_ty_def ( selcx,
904
905
impl_data. impl_def_id ,
905
- obligation. predicate . item_name ) ;
906
+ obligation. predicate . item_name ( selcx . tcx ( ) ) ) ;
906
907
907
908
let is_default = if node_item. node . is_from_trait ( ) {
908
909
// If true, the impl inherited a `type Foo = Bar`
@@ -1075,9 +1076,10 @@ fn confirm_object_candidate<'cx, 'gcx, 'tcx>(
1075
1076
1076
1077
// select only those projections that are actually projecting an
1077
1078
// item with the correct name
1079
+ let tcx = selcx. tcx ( ) ;
1078
1080
let env_predicates = env_predicates. filter_map ( |p| match p {
1079
1081
ty:: Predicate :: Projection ( data) =>
1080
- if data. item_name ( ) == obligation. predicate . item_name {
1082
+ if data. item_name ( tcx ) == obligation. predicate . item_name ( tcx ) {
1081
1083
Some ( data)
1082
1084
} else {
1083
1085
None
@@ -1180,10 +1182,11 @@ fn confirm_callable_candidate<'cx, 'gcx, 'tcx>(
1180
1182
flag) ;
1181
1183
1182
1184
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
+ ) ,
1187
1190
ty : ret_type
1188
1191
} ) ;
1189
1192
@@ -1228,7 +1231,7 @@ fn confirm_impl_candidate<'cx, 'gcx, 'tcx>(
1228
1231
let VtableImplData { substs, nested, impl_def_id } = impl_vtable;
1229
1232
1230
1233
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 ) ) ;
1232
1235
1233
1236
let ty = if !assoc_ty. item . defaultness . has_value ( ) {
1234
1237
// This means that the impl is missing a definition for the
0 commit comments