@@ -503,7 +503,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
503
503
if let PlaceContext :: NonMutatingUse ( NonMutatingUseContext :: Copy ) = context {
504
504
let tcx = self . tcx ( ) ;
505
505
let trait_ref = ty:: TraitRef {
506
- def_id : tcx. require_lang_item ( CopyTraitLangItem , None ) ,
506
+ def_id : tcx. require_lang_item ( CopyTraitLangItem , Some ( self . last_span ) ) ,
507
507
substs : tcx. mk_substs_trait ( place_ty. ty , & [ ] ) ,
508
508
} ;
509
509
@@ -1469,7 +1469,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
1469
1469
self . check_rvalue ( body, rv, location) ;
1470
1470
if !self . tcx ( ) . features ( ) . unsized_locals {
1471
1471
let trait_ref = ty:: TraitRef {
1472
- def_id : tcx. require_lang_item ( SizedTraitLangItem , None ) ,
1472
+ def_id : tcx. require_lang_item ( SizedTraitLangItem , Some ( self . last_span ) ) ,
1473
1473
substs : tcx. mk_substs_trait ( place_ty, & [ ] ) ,
1474
1474
} ;
1475
1475
self . prove_trait_ref (
@@ -2014,8 +2014,10 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2014
2014
ty:: Predicate :: Trait (
2015
2015
ty:: Binder :: bind ( ty:: TraitPredicate {
2016
2016
trait_ref : ty:: TraitRef :: new (
2017
- self . tcx ( )
2018
- . require_lang_item ( CopyTraitLangItem , None ) ,
2017
+ self . tcx ( ) . require_lang_item (
2018
+ CopyTraitLangItem ,
2019
+ Some ( self . last_span ) ,
2020
+ ) ,
2019
2021
tcx. mk_substs_trait ( ty, & [ ] ) ,
2020
2022
) ,
2021
2023
} ) ,
@@ -2039,7 +2041,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2039
2041
}
2040
2042
2041
2043
let trait_ref = ty:: TraitRef {
2042
- def_id : tcx. require_lang_item ( SizedTraitLangItem , None ) ,
2044
+ def_id : tcx. require_lang_item ( SizedTraitLangItem , Some ( self . last_span ) ) ,
2043
2045
substs : tcx. mk_substs_trait ( ty, & [ ] ) ,
2044
2046
} ;
2045
2047
@@ -2137,7 +2139,10 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2137
2139
CastKind :: Pointer ( PointerCast :: Unsize ) => {
2138
2140
let & ty = ty;
2139
2141
let trait_ref = ty:: TraitRef {
2140
- def_id : tcx. require_lang_item ( CoerceUnsizedTraitLangItem , None ) ,
2142
+ def_id : tcx. require_lang_item (
2143
+ CoerceUnsizedTraitLangItem ,
2144
+ Some ( self . last_span ) ,
2145
+ ) ,
2141
2146
substs : tcx. mk_substs_trait ( op. ty ( body, tcx) , & [ ty. into ( ) ] ) ,
2142
2147
} ;
2143
2148
0 commit comments