Skip to content

Commit

Permalink
Add a test with a leading newline for ICE rust-lang#90878
Browse files Browse the repository at this point in the history
  • Loading branch information
Noratrieb committed Nov 17, 2021
1 parent 495d8ed commit 96c37c8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/test/ui/consts/issue-90878-3.rs
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions src/test/ui/consts/issue-90878-3.stderr
Original file line number Diff line number Diff line change
@@ -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`.

0 comments on commit 96c37c8

Please sign in to comment.