fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.1 KiB29 linesraw
1error[E0080]: evaluation of `foo::<i32>::{constant#0}` failed
2  --> $DIR/const-expr-generic-err.rs:5:13
3   |
4LL |     const { assert!(std::mem::size_of::<T>() == 0); }
5   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'assertion failed: std::mem::size_of::<T>() == 0', $DIR/const-expr-generic-err.rs:5:13
6   |
7   = note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
8
9note: the above error was encountered while instantiating `fn foo::<i32>`
10  --> $DIR/const-expr-generic-err.rs:13:5
11   |
12LL |     foo::<i32>();
13   |     ^^^^^^^^^^^^
14
15error[E0080]: evaluation of `bar::<0>::{constant#0}` failed
16  --> $DIR/const-expr-generic-err.rs:9:13
17   |
18LL |     const { N - 1 }
19   |             ^^^^^ attempt to compute `0_usize - 1_usize`, which would overflow
20
21note: the above error was encountered while instantiating `fn bar::<0>`
22  --> $DIR/const-expr-generic-err.rs:14:5
23   |
24LL |     bar::<0>();
25   |     ^^^^^^^^^^
26
27error: aborting due to 2 previous errors
28
29For more information about this error, try `rustc --explain E0080`.