diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index 78ce76a0148..fd8a7db1b47 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -3158,7 +3158,7 @@ fn param_env<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, let unnormalized_env = ty::ParamEnv::new( tcx.intern_predicates(&predicates), traits::Reveal::UserFacing, - Some(def_id) + if tcx.sess.opts.debugging_opts.chalk { Some(def_id) } else { None } ); let body_id = tcx.hir().as_local_node_id(def_id).map_or(DUMMY_NODE_ID, |id| { diff --git a/src/test/ui/consts/const-size_of-cycle.stderr b/src/test/ui/consts/const-size_of-cycle.stderr index b837889400c..8f9498e834d 100644 --- a/src/test/ui/consts/const-size_of-cycle.stderr +++ b/src/test/ui/consts/const-size_of-cycle.stderr @@ -10,7 +10,7 @@ note: ...which requires const-evaluating `Foo::bytes::{{constant}}`... LL | intrinsics::size_of::() | ^^^^^^^^^^^^^^^^^^^^^^^^^^ note: ...which requires computing layout of `Foo`... -note: ...which requires normalizing `ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: All }, value: [u8; _] }`... +note: ...which requires normalizing `ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: All, def_id: None }, value: [u8; _] }`... note: ...which requires const-evaluating + checking `Foo::bytes::{{constant}}`... --> $DIR/const-size_of-cycle.rs:6:17 | diff --git a/src/test/ui/issues/issue-44415.stderr b/src/test/ui/issues/issue-44415.stderr index 21a935f57a9..441f1b2a069 100644 --- a/src/test/ui/issues/issue-44415.stderr +++ b/src/test/ui/issues/issue-44415.stderr @@ -10,7 +10,7 @@ note: ...which requires const-evaluating `Foo::bytes::{{constant}}`... LL | bytes: [u8; unsafe { intrinsics::size_of::() }], | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: ...which requires computing layout of `Foo`... -note: ...which requires normalizing `ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: All }, value: [u8; _] }`... +note: ...which requires normalizing `ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: All, def_id: None }, value: [u8; _] }`... note: ...which requires const-evaluating + checking `Foo::bytes::{{constant}}`... --> $DIR/issue-44415.rs:6:17 |