]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-54954.stderr
:arrow_up: rust-analyzer
[rust.git] / src / test / ui / issues / issue-54954.stderr
1 error[E0379]: functions in traits cannot be declared const
2   --> $DIR/issue-54954.rs:5:5
3    |
4 LL |     const fn const_val<T: Sized>() -> usize {
5    |     ^^^^^ functions in traits cannot be const
6
7 error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type
8   --> $DIR/issue-54954.rs:1:24
9    |
10 LL |   const ARR_LEN: usize = Tt::const_val::<[i8; 123]>();
11    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot call associated function of trait
12 ...
13 LL | /     const fn const_val<T: Sized>() -> usize {
14 LL | |
15 LL | |         core::mem::size_of::<T>()
16 LL | |     }
17    | |_____- `Tt::const_val` defined here
18
19 error[E0080]: evaluation of constant value failed
20   --> $DIR/issue-54954.rs:11:15
21    |
22 LL | fn f(z: [f32; ARR_LEN]) -> [f32; ARR_LEN] {
23    |               ^^^^^^^ referenced constant has errors
24
25 error[E0080]: evaluation of constant value failed
26   --> $DIR/issue-54954.rs:11:34
27    |
28 LL | fn f(z: [f32; ARR_LEN]) -> [f32; ARR_LEN] {
29    |                                  ^^^^^^^ referenced constant has errors
30
31 error: aborting due to 4 previous errors
32
33 Some errors have detailed explanations: E0080, E0379, E0790.
34 For more information about an error, try `rustc --explain E0080`.