]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-size_of-cycle.stderr
Get rid of special const intrinsic query in favour of `const_eval`
[rust.git] / src / test / ui / consts / const-size_of-cycle.stderr
1 error[E0391]: cycle detected when const-evaluating + checking `Foo::bytes::{{constant}}#0`
2   --> $DIR/const-size_of-cycle.rs:6:17
3    |
4 LL |     bytes: [u8; std::mem::size_of::<Foo>()]
5    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
6    |
7 note: ...which requires const-evaluating + checking `Foo::bytes::{{constant}}#0`...
8   --> $DIR/const-size_of-cycle.rs:6:17
9    |
10 LL |     bytes: [u8; std::mem::size_of::<Foo>()]
11    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
12 note: ...which requires const-evaluating `Foo::bytes::{{constant}}#0`...
13   --> $SRC_DIR/libcore/mem/mod.rs:LL:COL
14    |
15 LL |     intrinsics::size_of::<T>()
16    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
17 note: ...which requires const-evaluating + checking `std::intrinsics::size_of`...
18   --> $SRC_DIR/libcore/intrinsics.rs:LL:COL
19    |
20 LL |     pub fn size_of<T>() -> usize;
21    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22    = note: ...which requires computing layout of `Foo`...
23    = note: ...which requires normalizing `ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: All, def_id: None }, value: [u8; _] }`...
24    = note: ...which again requires const-evaluating + checking `Foo::bytes::{{constant}}#0`, completing the cycle
25 note: cycle used when processing `Foo`
26   --> $DIR/const-size_of-cycle.rs:5:1
27    |
28 LL | struct Foo {
29    | ^^^^^^^^^^
30
31 error: aborting due to previous error
32
33 For more information about this error, try `rustc --explain E0391`.