]> git.lizzy.rs Git - rust.git/commitdiff
Set a `def_id` in `ParamEnv` only with `-Z chalk`
authorscalexm <alexandre@scalexm.fr>
Thu, 20 Dec 2018 18:54:11 +0000 (19:54 +0100)
committerscalexm <alexandre@scalexm.fr>
Thu, 27 Dec 2018 18:21:17 +0000 (19:21 +0100)
src/librustc/ty/mod.rs
src/test/ui/consts/const-size_of-cycle.stderr
src/test/ui/issues/issue-44415.stderr

index 78ce76a01486f8ec82a1da33c1e054989d4629df..fd8a7db1b47604aab061e7433a5d992a38a3e41b 100644 (file)
@@ -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| {
index b837889400c8b3572a8407b75d993704bab9152b..8f9498e834d8ff11bcdc6c80727b9e80eda9b566 100644 (file)
@@ -10,7 +10,7 @@ note: ...which requires const-evaluating `Foo::bytes::{{constant}}`...
 LL |     intrinsics::size_of::<T>()
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
 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
    |
index 21a935f57a9b0d0173cf21eed4b6ee751b03a856..441f1b2a06960b27cffdff60690e4898005abb87 100644 (file)
@@ -10,7 +10,7 @@ note: ...which requires const-evaluating `Foo::bytes::{{constant}}`...
 LL |     bytes: [u8; unsafe { intrinsics::size_of::<Foo>() }],
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 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
    |