Add a test with a leading newline for ICE #90878

This commit is contained in:
Nilstrieb 2021-11-17 22:24:42 +01:00
parent 495d8ed246
commit 96c37c8a6a
2 changed files with 17 additions and 0 deletions

View file

@ -0,0 +1,6 @@
fn main() {
|x: usize| [0; x]; //~ ERROR attempt to use a non-constant value in a constant [E0435]
// (note the newline before "fn")
}
// ignore-tidy-leading-newlines

View file

@ -0,0 +1,11 @@
error[E0435]: attempt to use a non-constant value in a constant
--> $DIR/issue-90878-3.rs:3:20
|
LL | |x: usize| [0; x];
| - ^
| |
| this would need to be a `const`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0435`.