summaryrefslogtreecommitdiffstats
path: root/tests/ui/uninhabited
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
commit9918693037dce8aa4bb6f08741b6812923486c18 (patch)
tree21d2b40bec7e6a7ea664acee056eb3d08e15a1cf /tests/ui/uninhabited
parentReleasing progress-linux version 1.75.0+dfsg1-5~progress7.99u1. (diff)
downloadrustc-9918693037dce8aa4bb6f08741b6812923486c18.tar.xz
rustc-9918693037dce8aa4bb6f08741b6812923486c18.zip
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/uninhabited')
-rw-r--r--tests/ui/uninhabited/privately-uninhabited-mir-call.stderr2
-rw-r--r--tests/ui/uninhabited/uninhabited-irrefutable.stderr2
-rw-r--r--tests/ui/uninhabited/uninhabited-patterns.rs12
-rw-r--r--tests/ui/uninhabited/uninhabited-patterns.stderr26
4 files changed, 14 insertions, 28 deletions
diff --git a/tests/ui/uninhabited/privately-uninhabited-mir-call.stderr b/tests/ui/uninhabited/privately-uninhabited-mir-call.stderr
index 0dfd22a30..5f2f02c99 100644
--- a/tests/ui/uninhabited/privately-uninhabited-mir-call.stderr
+++ b/tests/ui/uninhabited/privately-uninhabited-mir-call.stderr
@@ -12,6 +12,6 @@ help: consider assigning a value
LL | let y: &mut u32 = todo!();
| +++++++++
-error: aborting due to previous error
+error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0381`.
diff --git a/tests/ui/uninhabited/uninhabited-irrefutable.stderr b/tests/ui/uninhabited/uninhabited-irrefutable.stderr
index daf75f51b..304e738ed 100644
--- a/tests/ui/uninhabited/uninhabited-irrefutable.stderr
+++ b/tests/ui/uninhabited/uninhabited-irrefutable.stderr
@@ -21,6 +21,6 @@ help: you might want to use `let else` to handle the variant that isn't matched
LL | let Foo::D(_y, _z) = x else { todo!() };
| ++++++++++++++++
-error: aborting due to previous error
+error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0005`.
diff --git a/tests/ui/uninhabited/uninhabited-patterns.rs b/tests/ui/uninhabited/uninhabited-patterns.rs
index f1573b6ad..4e90691e5 100644
--- a/tests/ui/uninhabited/uninhabited-patterns.rs
+++ b/tests/ui/uninhabited/uninhabited-patterns.rs
@@ -1,8 +1,6 @@
#![feature(box_patterns)]
#![feature(never_type)]
#![feature(exhaustive_patterns)]
-
-
#![deny(unreachable_patterns)]
mod foo {
@@ -23,22 +21,22 @@ fn main() {
let x: &[!] = &[];
match x {
- &[] => (),
- &[..] => (), //~ ERROR unreachable pattern
+ &[] => (),
+ &[..] => (),
};
let x: Result<Box<NotSoSecretlyEmpty>, &[Result<!, !>]> = Err(&[]);
match x {
- Ok(box _) => (), //~ ERROR unreachable pattern
+ Ok(box _) => (), //~ ERROR unreachable pattern
Err(&[]) => (),
- Err(&[..]) => (), //~ ERROR unreachable pattern
+ Err(&[..]) => (),
}
let x: Result<foo::SecretlyEmpty, Result<NotSoSecretlyEmpty, u32>> = Err(Err(123));
match x {
Ok(_y) => (),
Err(Err(_y)) => (),
- Err(Ok(_y)) => (), //~ ERROR unreachable pattern
+ Err(Ok(_y)) => (), //~ ERROR unreachable pattern
}
while let Some(_y) = foo() {
diff --git a/tests/ui/uninhabited/uninhabited-patterns.stderr b/tests/ui/uninhabited/uninhabited-patterns.stderr
index 655569ad6..a6fda88f0 100644
--- a/tests/ui/uninhabited/uninhabited-patterns.stderr
+++ b/tests/ui/uninhabited/uninhabited-patterns.stderr
@@ -1,38 +1,26 @@
error: unreachable pattern
- --> $DIR/uninhabited-patterns.rs:27:9
+ --> $DIR/uninhabited-patterns.rs:30:9
|
-LL | &[..] => (),
- | ^^^^^
+LL | Ok(box _) => (),
+ | ^^^^^^^^^
|
note: the lint level is defined here
- --> $DIR/uninhabited-patterns.rs:6:9
+ --> $DIR/uninhabited-patterns.rs:4:9
|
LL | #![deny(unreachable_patterns)]
| ^^^^^^^^^^^^^^^^^^^^
error: unreachable pattern
- --> $DIR/uninhabited-patterns.rs:32:9
- |
-LL | Ok(box _) => (),
- | ^^^^^^^^^
-
-error: unreachable pattern
- --> $DIR/uninhabited-patterns.rs:34:9
- |
-LL | Err(&[..]) => (),
- | ^^^^^^^^^^
-
-error: unreachable pattern
- --> $DIR/uninhabited-patterns.rs:41:9
+ --> $DIR/uninhabited-patterns.rs:39:9
|
LL | Err(Ok(_y)) => (),
| ^^^^^^^^^^^
error: unreachable pattern
- --> $DIR/uninhabited-patterns.rs:44:15
+ --> $DIR/uninhabited-patterns.rs:42:15
|
LL | while let Some(_y) = foo() {
| ^^^^^^^^
-error: aborting due to 5 previous errors
+error: aborting due to 3 previous errors