File tree 2 files changed +20
-10
lines changed
src/test/ui/const-generics/const_evaluatable_checked
2 files changed +20
-10
lines changed Original file line number Diff line number Diff line change 4
4
// We do not yet want to support let-bindings in abstract consts,
5
5
// so this test should keep failing for now.
6
6
fn test < const N : usize > ( ) -> [ u8 ; { let x = N ; N + 1 } ] where [ u8 ; { let x = N ; N + 1 } ] : Default {
7
- //~^ ERROR constant expression depends
8
- //~| ERROR constant expression depends
7
+ //~^ ERROR overly complex generic constant
8
+ //~| ERROR overly complex generic constant
9
9
Default :: default ( )
10
10
}
11
11
Original file line number Diff line number Diff line change 1
- error: constant expression depends on a generic parameter
2
- --> $DIR/let-bindings.rs:6:91
1
+ error: overly complex generic constant
2
+ --> $DIR/let-bindings.rs:6:68
3
3
|
4
4
LL | fn test<const N: usize>() -> [u8; { let x = N; N + 1 }] where [u8; { let x = N; N + 1 }]: Default {
5
- | ^^^^^^^ required by this bound in `test::{{constant}}#0`
5
+ | ^^^^^^^^^^^^^^^^^^^^
6
6
|
7
- = note: this may fail depending on what value the parameter takes
7
+ note: unsupported statement
8
+ --> $DIR/let-bindings.rs:6:74
9
+ |
10
+ LL | fn test<const N: usize>() -> [u8; { let x = N; N + 1 }] where [u8; { let x = N; N + 1 }]: Default {
11
+ | ^
12
+ = help: consider moving this anonymous constant into a `const` function
8
13
9
- error: constant expression depends on a generic parameter
10
- --> $DIR/let-bindings.rs:6:30
14
+ error: overly complex generic constant
15
+ --> $DIR/let-bindings.rs:6:35
11
16
|
12
17
LL | fn test<const N: usize>() -> [u8; { let x = N; N + 1 }] where [u8; { let x = N; N + 1 }]: Default {
13
- | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^
18
+ | ^^^^^^^^^^^^^^^^^^^^
14
19
|
15
- = note: this may fail depending on what value the parameter takes
20
+ note: unsupported statement
21
+ --> $DIR/let-bindings.rs:6:41
22
+ |
23
+ LL | fn test<const N: usize>() -> [u8; { let x = N; N + 1 }] where [u8; { let x = N; N + 1 }]: Default {
24
+ | ^
25
+ = help: consider moving this anonymous constant into a `const` function
16
26
17
27
error: aborting due to 2 previous errors
18
28
You can’t perform that action at this time.
0 commit comments