summaryrefslogtreecommitdiffstats
path: root/src/test/ui/suggestions/field-access.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/test/ui/suggestions/field-access.stderr
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/suggestions/field-access.stderr')
-rw-r--r--src/test/ui/suggestions/field-access.stderr67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/test/ui/suggestions/field-access.stderr b/src/test/ui/suggestions/field-access.stderr
new file mode 100644
index 000000000..b9f0f788b
--- /dev/null
+++ b/src/test/ui/suggestions/field-access.stderr
@@ -0,0 +1,67 @@
+error[E0308]: mismatched types
+ --> $DIR/field-access.rs:20:12
+ |
+LL | Fst,
+ | --- unit variant defined here
+...
+LL | if let B::Fst = a {};
+ | ^^^^^^ - this expression has type `A`
+ | |
+ | expected struct `A`, found enum `B`
+ |
+help: you might have meant to use field `b` whose type is `B`
+ |
+LL | if let B::Fst = a.b {};
+ | ~~~
+
+error[E0308]: mismatched types
+ --> $DIR/field-access.rs:25:9
+ |
+LL | Fst,
+ | --- unit variant defined here
+...
+LL | match a {
+ | - this expression has type `A`
+...
+LL | B::Fst => (),
+ | ^^^^^^ expected struct `A`, found enum `B`
+ |
+help: you might have meant to use field `b` whose type is `B`
+ |
+LL | match a.b {
+ | ~~~
+
+error[E0308]: mismatched types
+ --> $DIR/field-access.rs:26:9
+ |
+LL | Snd,
+ | --- unit variant defined here
+...
+LL | match a {
+ | - this expression has type `A`
+...
+LL | B::Snd => (),
+ | ^^^^^^ expected struct `A`, found enum `B`
+ |
+help: you might have meant to use field `b` whose type is `B`
+ |
+LL | match a.b {
+ | ~~~
+
+error[E0308]: mismatched types
+ --> $DIR/field-access.rs:32:9
+ |
+LL | match foo {
+ | --- this expression has type `Foo`
+LL |
+LL | 1u32 => (),
+ | ^^^^ expected union `Foo`, found `u32`
+ |
+help: you might have meant to use field `bar` whose type is `u32`
+ |
+LL | match unsafe { foo.bar } {
+ | ~~~~~~~~~~~~~~~~~~
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0308`.