Skip to content

Commit 51847a1

Browse files
committed
add FIXME related to constant well-formedness
1 parent abd6d0d commit 51847a1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/librustc_mir/transform/type_check.rs

+8
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,14 @@ impl<'a, 'b, 'gcx, 'tcx> TypeVerifier<'a, 'b, 'gcx, 'tcx> {
175175

176176
let expected_ty = match constant.literal {
177177
Literal::Value { value } => {
178+
// FIXME(#46702) -- We need some way to get the predicates
179+
// associated with the "pre-evaluated" form of the
180+
// constant. For example, consider that the constant
181+
// may have associated constant projections (`<Foo as
182+
// Trait<'a, 'b>>::SOME_CONST`) that impose
183+
// constraints on `'a` and `'b`. These constraints
184+
// would be lost if we just look at the normalized
185+
// value.
178186
if let ConstVal::Function(def_id, ..) = value.val {
179187
let tcx = self.tcx();
180188
let type_checker = &mut self.cx;

0 commit comments

Comments
 (0)