File tree Expand file tree Collapse file tree 2 files changed +20
-10
lines changed
src/test/ui/const-generics/const_evaluatable_checked Expand file tree Collapse file tree 2 files changed +20
-10
lines changed Original file line number Diff line number Diff line change 44// We do not yet want to support let-bindings in abstract consts,
55// so this test should keep failing for now.
66fn 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
99 Default :: default ( )
1010}
1111
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
33 |
44LL | 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+ | ^^^^^^^^^^^^^^^^^^^^
66 |
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
813
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
1116 |
1217LL | fn test<const N: usize>() -> [u8; { let x = N; N + 1 }] where [u8; { let x = N; N + 1 }]: Default {
13- | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^
18+ | ^^^^^^^^^^^^^^^^^^^^
1419 |
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
1626
1727error: aborting due to 2 previous errors
1828
You can’t perform that action at this time.
0 commit comments