Skip to content

Commit 993d213

Browse files
committed
Set a def_id in ParamEnv only with -Z chalk
1 parent 81d6f9c commit 993d213

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/librustc/ty/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3158,7 +3158,7 @@ fn param_env<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
31583158
let unnormalized_env = ty::ParamEnv::new(
31593159
tcx.intern_predicates(&predicates),
31603160
traits::Reveal::UserFacing,
3161-
Some(def_id)
3161+
if tcx.sess.opts.debugging_opts.chalk { Some(def_id) } else { None }
31623162
);
31633163

31643164
let body_id = tcx.hir().as_local_node_id(def_id).map_or(DUMMY_NODE_ID, |id| {

src/test/ui/consts/const-size_of-cycle.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ note: ...which requires const-evaluating `Foo::bytes::{{constant}}`...
1010
LL | intrinsics::size_of::<T>()
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
1212
note: ...which requires computing layout of `Foo`...
13-
note: ...which requires normalizing `ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: All }, value: [u8; _] }`...
13+
note: ...which requires normalizing `ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: All, def_id: None }, value: [u8; _] }`...
1414
note: ...which requires const-evaluating + checking `Foo::bytes::{{constant}}`...
1515
--> $DIR/const-size_of-cycle.rs:6:17
1616
|

src/test/ui/issues/issue-44415.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ note: ...which requires const-evaluating `Foo::bytes::{{constant}}`...
1010
LL | bytes: [u8; unsafe { intrinsics::size_of::<Foo>() }],
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1212
note: ...which requires computing layout of `Foo`...
13-
note: ...which requires normalizing `ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: All }, value: [u8; _] }`...
13+
note: ...which requires normalizing `ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: All, def_id: None }, value: [u8; _] }`...
1414
note: ...which requires const-evaluating + checking `Foo::bytes::{{constant}}`...
1515
--> $DIR/issue-44415.rs:6:17
1616
|

0 commit comments

Comments
 (0)