@@ -965,10 +965,10 @@ impl<'a, 'tcx> Instantiator<'a, 'tcx> {
965965 debug ! ( "instantiate_opaque_types: returning concrete ty {:?}" , opaque_defn. concrete_ty) ;
966966 return opaque_defn. concrete_ty ;
967967 }
968- let span = tcx . def_span ( def_id ) ;
969- debug ! ( "fold_opaque_ty {:?} {:?}" , self . value_span , span ) ;
970- let ty_var = infcx
971- . next_ty_var ( TypeVariableOrigin { kind : TypeVariableOriginKind :: TypeInference , span } ) ;
968+ let ty_var = infcx . next_ty_var ( TypeVariableOrigin {
969+ kind : TypeVariableOriginKind :: TypeInference ,
970+ span : self . value_span ,
971+ } ) ;
972972
973973 // Make sure that we are in fact defining the *entire* type
974974 // (e.g., `type Foo<T: Bound> = impl Bar;` needs to be
@@ -993,16 +993,12 @@ impl<'a, 'tcx> Instantiator<'a, 'tcx> {
993993 }
994994
995995 debug ! ( "instantiate_opaque_types: ty_var={:?}" , ty_var) ;
996- self . compute_opaque_type_obligations ( opaque_type_key, span ) ;
996+ self . compute_opaque_type_obligations ( opaque_type_key) ;
997997
998998 ty_var
999999 }
10001000
1001- fn compute_opaque_type_obligations (
1002- & mut self ,
1003- opaque_type_key : OpaqueTypeKey < ' tcx > ,
1004- span : Span ,
1005- ) {
1001+ fn compute_opaque_type_obligations ( & mut self , opaque_type_key : OpaqueTypeKey < ' tcx > ) {
10061002 let infcx = self . infcx ;
10071003 let tcx = infcx. tcx ;
10081004 let OpaqueTypeKey { def_id, substs } = opaque_type_key;
@@ -1014,7 +1010,7 @@ impl<'a, 'tcx> Instantiator<'a, 'tcx> {
10141010
10151011 let param_env = tcx. param_env ( def_id) ;
10161012 let InferOk { value : bounds, obligations } = infcx. partially_normalize_associated_types_in (
1017- ObligationCause :: misc ( span , self . body_id ) ,
1013+ ObligationCause :: misc ( self . value_span , self . body_id ) ,
10181014 param_env,
10191015 bounds,
10201016 ) ;
@@ -1038,7 +1034,8 @@ impl<'a, 'tcx> Instantiator<'a, 'tcx> {
10381034 // This also instantiates nested instances of `impl Trait`.
10391035 let predicate = self . instantiate_opaque_types_in_map ( predicate) ;
10401036
1041- let cause = traits:: ObligationCause :: new ( span, self . body_id , traits:: OpaqueType ) ;
1037+ let cause =
1038+ traits:: ObligationCause :: new ( self . value_span , self . body_id , traits:: OpaqueType ) ;
10421039
10431040 // Require that the predicate holds for the concrete type.
10441041 debug ! ( "instantiate_opaque_types: predicate={:?}" , predicate) ;
0 commit comments