fork/rust

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

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
1.1 KiB33 linesraw
1error[E0379]: trait fns cannot be declared const
2  --> $DIR/issue-54954.rs:7:5
3   |
4LL |     const fn const_val<T: Sized>() -> usize {
5   |     ^^^^^ trait fns cannot be const
6
7error[E0283]: type annotations needed
8  --> $DIR/issue-54954.rs:3:24
9   |
10LL | const ARR_LEN: usize = Tt::const_val::<[i8; 123]>();
11   |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
12...
13LL |     const fn const_val<T: Sized>() -> usize {
14   |              --------- - required by this bound in `Tt::const_val`
15   |
16   = note: cannot resolve `_: Tt`
17
18error[E0080]: evaluation of constant value failed
19  --> $DIR/issue-54954.rs:13:15
20   |
21LL | fn f(z: [f32; ARR_LEN]) -> [f32; ARR_LEN] {
22   |               ^^^^^^^ referenced constant has errors
23
24error[E0080]: evaluation of constant value failed
25  --> $DIR/issue-54954.rs:13:34
26   |
27LL | fn f(z: [f32; ARR_LEN]) -> [f32; ARR_LEN] {
28   |                                  ^^^^^^^ referenced constant has errors
29
30error: aborting due to 4 previous errors
31
32Some errors have detailed explanations: E0080, E0283, E0379.
33For more information about an error, try `rustc --explain E0080`.