summaryrefslogtreecommitdiffstats
path: root/tests/ui/structs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/structs')
-rw-r--r--tests/ui/structs/struct-path-alias-bounds.stderr3
-rw-r--r--tests/ui/structs/struct-tuple-field-names.rs3
-rw-r--r--tests/ui/structs/struct-tuple-field-names.stderr20
3 files changed, 23 insertions, 3 deletions
diff --git a/tests/ui/structs/struct-path-alias-bounds.stderr b/tests/ui/structs/struct-path-alias-bounds.stderr
index 266291f62..5b01208c5 100644
--- a/tests/ui/structs/struct-path-alias-bounds.stderr
+++ b/tests/ui/structs/struct-path-alias-bounds.stderr
@@ -11,7 +11,8 @@ LL | struct S<T: Clone> { a: T }
| ^^^^^ required by this bound in `S`
help: consider annotating `NoClone` with `#[derive(Clone)]`
|
-LL | #[derive(Clone)]
+LL + #[derive(Clone)]
+LL | struct NoClone;
|
error: aborting due to previous error
diff --git a/tests/ui/structs/struct-tuple-field-names.rs b/tests/ui/structs/struct-tuple-field-names.rs
index 7bd54af1d..33f264aa2 100644
--- a/tests/ui/structs/struct-tuple-field-names.rs
+++ b/tests/ui/structs/struct-tuple-field-names.rs
@@ -12,4 +12,7 @@ fn main() {
match y {
S { } => {} //~ ERROR: tuple variant `S` written as struct variant [E0769]
}
+
+ if let E::S { 0: a } = x { //~ ERROR: pattern does not mention field `1`
+ }
}
diff --git a/tests/ui/structs/struct-tuple-field-names.stderr b/tests/ui/structs/struct-tuple-field-names.stderr
index 5494c29a6..0b837a47a 100644
--- a/tests/ui/structs/struct-tuple-field-names.stderr
+++ b/tests/ui/structs/struct-tuple-field-names.stderr
@@ -20,6 +20,22 @@ help: use the tuple variant pattern syntax instead
LL | S(_, _) => {}
| ~~~~~~
-error: aborting due to 2 previous errors
+error[E0027]: pattern does not mention field `1`
+ --> $DIR/struct-tuple-field-names.rs:16:12
+ |
+LL | if let E::S { 0: a } = x {
+ | ^^^^^^^^^^^^^ missing field `1`
+ |
+help: include the missing field in the pattern
+ |
+LL | if let E::S { 0: a, 1: _ } = x {
+ | ~~~~~~~~
+help: if you don't care about this missing field, you can explicitly ignore it
+ |
+LL | if let E::S { 0: a, .. } = x {
+ | ~~~~~~
+
+error: aborting due to 3 previous errors
-For more information about this error, try `rustc --explain E0769`.
+Some errors have detailed explanations: E0027, E0769.
+For more information about an error, try `rustc --explain E0027`.