summary refs log tree commit diff
path: root/src/test/ui/parser
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2019-03-14 18:28:24 -0700
committerEsteban Küber <esteban@kuber.com.ar>2019-03-14 18:28:24 -0700
commit6cd6759cfcb9794dba4cc2a5a1fae6ae63706d12 (patch)
tree50b009048b030239d0682f41aa44b6298393ffff /src/test/ui/parser
parent7486b9c208f7e1c4aa1e36961927327bd793e952 (diff)
downloadrust-6cd6759cfcb9794dba4cc2a5a1fae6ae63706d12.tar.gz
rust-6cd6759cfcb9794dba4cc2a5a1fae6ae63706d12.zip
Do not complain about unmentioned fields in recovered patterns
When the parser has to recover from malformed code in a pattern, do not
complain about missing fields.
Diffstat (limited to 'src/test/ui/parser')
-rw-r--r--src/test/ui/parser/bind-struct-early-modifiers.rs1
-rw-r--r--src/test/ui/parser/bind-struct-early-modifiers.stderr9
-rw-r--r--src/test/ui/parser/issue-10392.rs1
-rw-r--r--src/test/ui/parser/issue-10392.stderr9
4 files changed, 2 insertions, 18 deletions
diff --git a/src/test/ui/parser/bind-struct-early-modifiers.rs b/src/test/ui/parser/bind-struct-early-modifiers.rs
index c1de0df54e2..c4b1937de10 100644
--- a/src/test/ui/parser/bind-struct-early-modifiers.rs
+++ b/src/test/ui/parser/bind-struct-early-modifiers.rs
@@ -2,7 +2,6 @@ fn main() {
     struct Foo { x: isize }
     match (Foo { x: 10 }) {
         Foo { ref x: ref x } => {}, //~ ERROR expected `,`
-                                    //~| ERROR pattern does not mention field `x`
         _ => {}
     }
 }
diff --git a/src/test/ui/parser/bind-struct-early-modifiers.stderr b/src/test/ui/parser/bind-struct-early-modifiers.stderr
index 50c95b8cf40..03482a41f54 100644
--- a/src/test/ui/parser/bind-struct-early-modifiers.stderr
+++ b/src/test/ui/parser/bind-struct-early-modifiers.stderr
@@ -4,12 +4,5 @@ error: expected `,`
 LL |         Foo { ref x: ref x } => {},
    |                   ^
 
-error[E0027]: pattern does not mention field `x`
-  --> $DIR/bind-struct-early-modifiers.rs:4:9
-   |
-LL |         Foo { ref x: ref x } => {},
-   |         ^^^^^^^^^^^^^^^^^^^^ missing field `x`
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0027`.
diff --git a/src/test/ui/parser/issue-10392.rs b/src/test/ui/parser/issue-10392.rs
index dd84af39300..5b0c2fc2be4 100644
--- a/src/test/ui/parser/issue-10392.rs
+++ b/src/test/ui/parser/issue-10392.rs
@@ -4,5 +4,4 @@ fn a() -> A { panic!() }
 
 fn main() {
     let A { , } = a(); //~ ERROR expected ident
-                       //~| ERROR pattern does not mention field `foo`
 }
diff --git a/src/test/ui/parser/issue-10392.stderr b/src/test/ui/parser/issue-10392.stderr
index 7bf5aa93f0a..34991151c1e 100644
--- a/src/test/ui/parser/issue-10392.stderr
+++ b/src/test/ui/parser/issue-10392.stderr
@@ -4,12 +4,5 @@ error: expected identifier, found `,`
 LL |     let A { , } = a();
    |             ^ expected identifier
 
-error[E0027]: pattern does not mention field `foo`
-  --> $DIR/issue-10392.rs:6:9
-   |
-LL |     let A { , } = a();
-   |         ^^^^^^^ missing field `foo`
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0027`.