fork/rust

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

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
731 B21 linesraw
1error[E0379]: functions in traits cannot be declared const
2  --> $DIR/issue-54954.rs:7:5
3   |
4LL |     const fn const_val<T: Sized>() -> usize {
5   |     ^^^^^ functions in traits 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 satisfy `_: Tt`
17
18error: aborting due to 2 previous errors
19
20Some errors have detailed explanations: E0283, E0379.
21For more information about an error, try `rustc --explain E0283`.