@@ -572,7 +572,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
572
572
let tcx = self . tcx ( ) ;
573
573
let trait_ref = ty:: TraitRef {
574
574
def_id : tcx. require_lang_item ( LangItem :: Copy , Some ( self . last_span ) ) ,
575
- substs : tcx. mk_substs_trait ( place_ty. ty , & [ ] ) ,
575
+ substs : tcx. mk_substs_trait ( place_ty. ty , & [ ] , ty :: ConstnessArg :: Not ) ,
576
576
} ;
577
577
578
578
// To have a `Copy` operand, the type `T` of the
@@ -1304,7 +1304,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
1304
1304
if !self . unsized_feature_enabled ( ) {
1305
1305
let trait_ref = ty:: TraitRef {
1306
1306
def_id : tcx. require_lang_item ( LangItem :: Sized , Some ( self . last_span ) ) ,
1307
- substs : tcx. mk_substs_trait ( place_ty, & [ ] ) ,
1307
+ substs : tcx. mk_substs_trait ( place_ty, & [ ] , ty :: ConstnessArg :: Not ) ,
1308
1308
} ;
1309
1309
self . prove_trait_ref (
1310
1310
trait_ref,
@@ -1894,7 +1894,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
1894
1894
let ty = place. ty ( body, tcx) . ty ;
1895
1895
let trait_ref = ty:: TraitRef :: new (
1896
1896
tcx. require_lang_item ( LangItem :: Copy , Some ( span) ) ,
1897
- tcx. mk_substs_trait ( ty, & [ ] ) ,
1897
+ tcx. mk_substs_trait ( ty, & [ ] , ty :: ConstnessArg :: Not ) ,
1898
1898
) ;
1899
1899
1900
1900
self . prove_trait_ref (
@@ -1910,7 +1910,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
1910
1910
& Rvalue :: NullaryOp ( _, ty) => {
1911
1911
let trait_ref = ty:: TraitRef {
1912
1912
def_id : tcx. require_lang_item ( LangItem :: Sized , Some ( self . last_span ) ) ,
1913
- substs : tcx. mk_substs_trait ( ty, & [ ] ) ,
1913
+ substs : tcx. mk_substs_trait ( ty, & [ ] , ty :: ConstnessArg :: Not ) ,
1914
1914
} ;
1915
1915
1916
1916
self . prove_trait_ref (
@@ -1925,7 +1925,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
1925
1925
1926
1926
let trait_ref = ty:: TraitRef {
1927
1927
def_id : tcx. require_lang_item ( LangItem :: Sized , Some ( self . last_span ) ) ,
1928
- substs : tcx. mk_substs_trait ( * ty, & [ ] ) ,
1928
+ substs : tcx. mk_substs_trait ( * ty, & [ ] , ty :: ConstnessArg :: Not ) ,
1929
1929
} ;
1930
1930
1931
1931
self . prove_trait_ref (
@@ -2026,7 +2026,12 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
2026
2026
let trait_ref = ty:: TraitRef {
2027
2027
def_id : tcx
2028
2028
. require_lang_item ( LangItem :: CoerceUnsized , Some ( self . last_span ) ) ,
2029
- substs : tcx. mk_substs_trait ( op. ty ( body, tcx) , & [ ty. into ( ) ] ) ,
2029
+ // TODO: pick constness arg from context
2030
+ substs : tcx. mk_substs_trait (
2031
+ op. ty ( body, tcx) ,
2032
+ & [ ty. into ( ) ] ,
2033
+ ty:: ConstnessArg :: Not ,
2034
+ ) ,
2030
2035
} ;
2031
2036
2032
2037
self . prove_trait_ref (
0 commit comments