@@ -965,10 +965,10 @@ impl<'a, 'tcx> Instantiator<'a, 'tcx> {
965
965
debug ! ( "instantiate_opaque_types: returning concrete ty {:?}" , opaque_defn. concrete_ty) ;
966
966
return opaque_defn. concrete_ty ;
967
967
}
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
+ } ) ;
972
972
973
973
// Make sure that we are in fact defining the *entire* type
974
974
// (e.g., `type Foo<T: Bound> = impl Bar;` needs to be
@@ -993,16 +993,12 @@ impl<'a, 'tcx> Instantiator<'a, 'tcx> {
993
993
}
994
994
995
995
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) ;
997
997
998
998
ty_var
999
999
}
1000
1000
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 > ) {
1006
1002
let infcx = self . infcx ;
1007
1003
let tcx = infcx. tcx ;
1008
1004
let OpaqueTypeKey { def_id, substs } = opaque_type_key;
@@ -1014,7 +1010,7 @@ impl<'a, 'tcx> Instantiator<'a, 'tcx> {
1014
1010
1015
1011
let param_env = tcx. param_env ( def_id) ;
1016
1012
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 ) ,
1018
1014
param_env,
1019
1015
bounds,
1020
1016
) ;
@@ -1038,7 +1034,8 @@ impl<'a, 'tcx> Instantiator<'a, 'tcx> {
1038
1034
// This also instantiates nested instances of `impl Trait`.
1039
1035
let predicate = self . instantiate_opaque_types_in_map ( predicate) ;
1040
1036
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 ) ;
1042
1039
1043
1040
// Require that the predicate holds for the concrete type.
1044
1041
debug ! ( "instantiate_opaque_types: predicate={:?}" , predicate) ;
0 commit comments