diff options
| author | Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> | 2021-11-17 22:24:42 +0100 |
|---|---|---|
| committer | Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> | 2021-11-17 22:24:42 +0100 |
| commit | 96c37c8a6a4bbfe34a81754e174bfc2e41d194f6 (patch) | |
| tree | 3d6e394ec51b3161359c13f670fdeb81b65c3e5a | |
| parent | 495d8ed246ec659127ee646b55e0ea7874ecb82f (diff) | |
| download | rust-96c37c8a6a4bbfe34a81754e174bfc2e41d194f6.tar.gz rust-96c37c8a6a4bbfe34a81754e174bfc2e41d194f6.zip | |
Add a test with a leading newline for ICE #90878
| -rw-r--r-- | src/test/ui/consts/issue-90878-3.rs | 6 | ||||
| -rw-r--r-- | src/test/ui/consts/issue-90878-3.stderr | 11 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/test/ui/consts/issue-90878-3.rs b/src/test/ui/consts/issue-90878-3.rs new file mode 100644 index 00000000000..0e36646eb49 --- /dev/null +++ b/src/test/ui/consts/issue-90878-3.rs @@ -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 diff --git a/src/test/ui/consts/issue-90878-3.stderr b/src/test/ui/consts/issue-90878-3.stderr new file mode 100644 index 00000000000..1bcc0eb3787 --- /dev/null +++ b/src/test/ui/consts/issue-90878-3.stderr @@ -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`. |
