Skip to content

Commit 21e8d63

Browse files
committed
Don't reveal in const prop
1 parent b312929 commit 21e8d63

4 files changed

+1
-16
lines changed

compiler/rustc_mir_transform/src/const_prop_lint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
176176
) -> ConstPropagator<'mir, 'tcx> {
177177
let def_id = body.source.def_id();
178178
let args = &GenericArgs::identity_for_item(tcx, def_id);
179-
let param_env = tcx.param_env_reveal_all_normalized(def_id);
179+
let param_env = tcx.param_env(def_id);
180180

181181
let can_const_prop = CanConstProp::check(tcx, param_env, body);
182182
let mut ecx = InterpCx::new(

tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.stderr

-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ error[E0391]: cycle detected when elaborating drops for `<impl at $DIR/issue-249
44
LL | const BAR: u32 = IMPL_REF_BAR;
55
| ^^^^^^^^^^^^
66
|
7-
note: ...which requires const-evaluating + checking `IMPL_REF_BAR`...
8-
--> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:7:1
9-
|
10-
LL | const IMPL_REF_BAR: u32 = GlobalImplRef::BAR;
11-
| ^^^^^^^^^^^^^^^^^^^^^^^
127
note: ...which requires const-evaluating + checking `IMPL_REF_BAR`...
138
--> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:7:27
149
|

tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.stderr

-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ error[E0391]: cycle detected when elaborating drops for `FooDefault::BAR`
44
LL | const BAR: u32 = DEFAULT_REF_BAR;
55
| ^^^^^^^^^^^^^^^
66
|
7-
note: ...which requires const-evaluating + checking `DEFAULT_REF_BAR`...
8-
--> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:11:1
9-
|
10-
LL | const DEFAULT_REF_BAR: u32 = <GlobalDefaultRef>::BAR;
11-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
127
note: ...which requires const-evaluating + checking `DEFAULT_REF_BAR`...
138
--> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:11:30
149
|

tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr

-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ error[E0391]: cycle detected when elaborating drops for `<impl at $DIR/issue-249
44
LL | const BAR: u32 = TRAIT_REF_BAR;
55
| ^^^^^^^^^^^^^
66
|
7-
note: ...which requires const-evaluating + checking `TRAIT_REF_BAR`...
8-
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:7:1
9-
|
10-
LL | const TRAIT_REF_BAR: u32 = <GlobalTraitRef>::BAR;
11-
| ^^^^^^^^^^^^^^^^^^^^^^^^
127
note: ...which requires const-evaluating + checking `TRAIT_REF_BAR`...
138
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:7:28
149
|

0 commit comments

Comments
 (0)