]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-size_of-cycle.stderr
Rollup merge of #72279 - RalfJung:raw-ref-macros, r=nikomatsakis
[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:4: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:4:17
9    |
10 LL |     bytes: [u8; std::mem::size_of::<Foo>()]
11    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
12 note: ...which requires const-evaluating `Foo::bytes::{{constant}}#0`...
13   --> $DIR/const-size_of-cycle.rs:4:17
14    |
15 LL |     bytes: [u8; std::mem::size_of::<Foo>()]
16    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
17 note: ...which requires const-evaluating `std::mem::size_of`...
18   --> $SRC_DIR/libcore/mem/mod.rs:LL:COL
19    |
20 LL | pub const fn size_of<T>() -> usize {
21    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22 note: ...which requires const-evaluating + checking `std::intrinsics::size_of`...
23   --> $SRC_DIR/libcore/intrinsics.rs:LL:COL
24    |
25 LL |     pub fn size_of<T>() -> usize;
26    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
27    = note: ...which requires computing layout of `Foo`...
28    = note: ...which requires normalizing `[u8; _]`...
29    = note: ...which again requires const-evaluating + checking `Foo::bytes::{{constant}}#0`, completing the cycle
30 note: cycle used when checking that `Foo` is well-formed
31   --> $DIR/const-size_of-cycle.rs:3:1
32    |
33 LL | struct Foo {
34    | ^^^^^^^^^^
35
36 error: aborting due to previous error
37
38 For more information about this error, try `rustc --explain E0391`.