fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #71868 - Mark-Simulacrum:stable-1.43.1, r=pietroalbini8d69840ab92

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