@@ -503,7 +503,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
503503 if let PlaceContext :: NonMutatingUse ( NonMutatingUseContext :: Copy ) = context {
504504 let tcx = self . tcx ( ) ;
505505 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 ) ) ,
507507 substs : tcx. mk_substs_trait ( place_ty. ty , & [ ] ) ,
508508 } ;
509509
@@ -1469,7 +1469,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
14691469 self . check_rvalue ( body, rv, location) ;
14701470 if !self . tcx ( ) . features ( ) . unsized_locals {
14711471 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 ) ) ,
14731473 substs : tcx. mk_substs_trait ( place_ty, & [ ] ) ,
14741474 } ;
14751475 self . prove_trait_ref (
@@ -2014,8 +2014,10 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
20142014 ty:: Predicate :: Trait (
20152015 ty:: Binder :: bind ( ty:: TraitPredicate {
20162016 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+ ) ,
20192021 tcx. mk_substs_trait ( ty, & [ ] ) ,
20202022 ) ,
20212023 } ) ,
@@ -2039,7 +2041,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
20392041 }
20402042
20412043 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 ) ) ,
20432045 substs : tcx. mk_substs_trait ( ty, & [ ] ) ,
20442046 } ;
20452047
@@ -2137,7 +2139,10 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
21372139 CastKind :: Pointer ( PointerCast :: Unsize ) => {
21382140 let & ty = ty;
21392141 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+ ) ,
21412146 substs : tcx. mk_substs_trait ( op. ty ( body, tcx) , & [ ty. into ( ) ] ) ,
21422147 } ;
21432148
0 commit comments