Skip to content

Commit 914bc17

Browse files
author
Daniel Noom
committed
Add notes to stderr of non-exhaustive-reference test
1 parent 9cba8a3 commit 914bc17

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
enum A {}
2+
//~^ NOTE `A` defined here
23

34
fn f(a: &A) {
4-
match a {} //~ ERROR non-exhaustive patterns: type `&A` is non-empty
5+
match a {}
6+
//~^ ERROR non-exhaustive patterns: type `&A` is non-empty
7+
//~| NOTE the matched value is of type `&A`
8+
//~| NOTE references are always considered inhabited
59
}
610

711
fn main() {}

src/test/ui/pattern/usefulness/issue-78123-non-exhaustive-reference.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0004]: non-exhaustive patterns: type `&A` is non-empty
2-
--> $DIR/issue-78123-non-exhaustive-reference.rs:4:11
2+
--> $DIR/issue-78123-non-exhaustive-reference.rs:5:11
33
|
44
LL | enum A {}
55
| --------- `A` defined here

0 commit comments

Comments
 (0)