Skip to content

Commit 11026ec

Browse files
oli-obkfee1-dead
authored andcommitted
Update mir typeck
1 parent 1b70638 commit 11026ec

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

compiler/rustc_borrowck/src/type_check/canonical.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
9393
self.prove_predicates(
9494
Some(ty::Binder::dummy(ty::PredicateKind::Trait(ty::TraitPredicate {
9595
trait_ref,
96-
constness: ty::BoundConstness::NotConst,
9796
polarity: ty::ImplPolarity::Positive,
9897
}))),
9998
locations,

compiler/rustc_borrowck/src/type_check/mod.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
572572
let tcx = self.tcx();
573573
let trait_ref = ty::TraitRef {
574574
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),
576576
};
577577

578578
// To have a `Copy` operand, the type `T` of the
@@ -1304,7 +1304,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
13041304
if !self.unsized_feature_enabled() {
13051305
let trait_ref = ty::TraitRef {
13061306
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),
13081308
};
13091309
self.prove_trait_ref(
13101310
trait_ref,
@@ -1894,7 +1894,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
18941894
let ty = place.ty(body, tcx).ty;
18951895
let trait_ref = ty::TraitRef::new(
18961896
tcx.require_lang_item(LangItem::Copy, Some(span)),
1897-
tcx.mk_substs_trait(ty, &[]),
1897+
tcx.mk_substs_trait(ty, &[], ty::ConstnessArg::Not),
18981898
);
18991899

19001900
self.prove_trait_ref(
@@ -1910,7 +1910,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
19101910
&Rvalue::NullaryOp(_, ty) => {
19111911
let trait_ref = ty::TraitRef {
19121912
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),
19141914
};
19151915

19161916
self.prove_trait_ref(
@@ -1925,7 +1925,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
19251925

19261926
let trait_ref = ty::TraitRef {
19271927
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),
19291929
};
19301930

19311931
self.prove_trait_ref(
@@ -2026,7 +2026,12 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
20262026
let trait_ref = ty::TraitRef {
20272027
def_id: tcx
20282028
.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+
),
20302035
};
20312036

20322037
self.prove_trait_ref(

0 commit comments

Comments
 (0)