about summary refs log tree commit diff
path: root/src/test/parse-fail
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2016-03-31 05:04:59 +0530
committerManish Goregaokar <manishsmail@gmail.com>2016-03-31 05:04:59 +0530
commit74546e8ab795a5fabdf4f5079a875b8c69573003 (patch)
tree5693f2f5a1012e27364f689c03f988afaf8d38a1 /src/test/parse-fail
parent9957081e78643aafab55f35c96d7c08936521dea (diff)
parente1d8ad3fb0a1fc764bd2b117141ee94ef78460e6 (diff)
downloadrust-74546e8ab795a5fabdf4f5079a875b8c69573003.tar.gz
rust-74546e8ab795a5fabdf4f5079a875b8c69573003.zip
Rollup merge of #32494 - pnkfelix:gate-parser-recovery-via-debugflag, r=nrc
Gate parser recovery via debugflag

Gate parser recovery via debugflag

Put in `-Z continue_parse_after_error`

This works by adding a method, `fn abort_if_no_parse_recovery`, to the
diagnostic handler in `syntax::errors`, and calling it after each
error is emitted in the parser.

(We might consider adding a debugflag to do such aborts in other
places where we are currently attempting recovery, such as resolve,
but I think the parser is the really important case to handle in the
face of #31994 and the parser bugs of varying degrees that were
injected by parse error recovery.)

r? @nikomatsakis
Diffstat (limited to 'src/test/parse-fail')
-rw-r--r--src/test/parse-fail/ascii-only-character-escape.rs2
-rw-r--r--src/test/parse-fail/bad-char-literals.rs2
-rw-r--r--src/test/parse-fail/bad-lit-suffixes.rs2
-rw-r--r--src/test/parse-fail/byte-literals.rs2
-rw-r--r--src/test/parse-fail/byte-string-literals.rs2
-rw-r--r--src/test/parse-fail/issue-10412.rs2
-rw-r--r--src/test/parse-fail/issue-23620-invalid-escapes.rs2
-rw-r--r--src/test/parse-fail/lex-bad-binary-literal.rs2
-rw-r--r--src/test/parse-fail/lex-bad-char-literals-1.rs2
-rw-r--r--src/test/parse-fail/lex-bad-numeric-literals.rs2
-rw-r--r--src/test/parse-fail/lex-bare-cr-string-literal-doc-comment.rs2
-rw-r--r--src/test/parse-fail/new-unicode-escapes-4.rs2
-rw-r--r--src/test/parse-fail/no-unsafe-self.rs2
13 files changed, 15 insertions, 11 deletions
diff --git a/src/test/parse-fail/ascii-only-character-escape.rs b/src/test/parse-fail/ascii-only-character-escape.rs
index 2094b63ab36..a8c40225c30 100644
--- a/src/test/parse-fail/ascii-only-character-escape.rs
+++ b/src/test/parse-fail/ascii-only-character-escape.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// compile-flags: -Z parse-only
+// compile-flags: -Z parse-only -Z continue-parse-after-error
 
 fn main() {
     let x = "\x80"; //~ ERROR may only be used
diff --git a/src/test/parse-fail/bad-char-literals.rs b/src/test/parse-fail/bad-char-literals.rs
index fe8ed8bb9a5..96311d6de17 100644
--- a/src/test/parse-fail/bad-char-literals.rs
+++ b/src/test/parse-fail/bad-char-literals.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// compile-flags: -Z parse-only
+// compile-flags: -Z parse-only -Z continue-parse-after-error
 
 // ignore-tidy-cr
 // ignore-tidy-tab
diff --git a/src/test/parse-fail/bad-lit-suffixes.rs b/src/test/parse-fail/bad-lit-suffixes.rs
index d5985fcebeb..0811a647024 100644
--- a/src/test/parse-fail/bad-lit-suffixes.rs
+++ b/src/test/parse-fail/bad-lit-suffixes.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// compile-flags: -Z parse-only
+// compile-flags: -Z parse-only -Z continue-parse-after-error
 
 
 extern
diff --git a/src/test/parse-fail/byte-literals.rs b/src/test/parse-fail/byte-literals.rs
index 3321f2450c1..3ecd7780afd 100644
--- a/src/test/parse-fail/byte-literals.rs
+++ b/src/test/parse-fail/byte-literals.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// compile-flags: -Z parse-only
+// compile-flags: -Z parse-only -Z continue-parse-after-error
 
 
 // ignore-tidy-tab
diff --git a/src/test/parse-fail/byte-string-literals.rs b/src/test/parse-fail/byte-string-literals.rs
index 22f123416f2..4eba9e91ca5 100644
--- a/src/test/parse-fail/byte-string-literals.rs
+++ b/src/test/parse-fail/byte-string-literals.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// compile-flags: -Z parse-only
+// compile-flags: -Z parse-only -Z continue-parse-after-error
 
 
 // ignore-tidy-tab
diff --git a/src/test/parse-fail/issue-10412.rs b/src/test/parse-fail/issue-10412.rs
index 0b9456bc080..b75e7b12bbd 100644
--- a/src/test/parse-fail/issue-10412.rs
+++ b/src/test/parse-fail/issue-10412.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// compile-flags: -Z parse-only
+// compile-flags: -Z parse-only -Z continue-parse-after-error
 
 
 trait Serializable<'self, T> { //~ ERROR no longer a special lifetime
diff --git a/src/test/parse-fail/issue-23620-invalid-escapes.rs b/src/test/parse-fail/issue-23620-invalid-escapes.rs
index d2f78ef897b..821149d1d00 100644
--- a/src/test/parse-fail/issue-23620-invalid-escapes.rs
+++ b/src/test/parse-fail/issue-23620-invalid-escapes.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// compile-flags: -Z parse-only -Z continue-parse-after-error
+
 fn main() {
     let _ = b"\u{a66e}";
     //~^ ERROR unicode escape sequences cannot be used as a byte or in a byte string
diff --git a/src/test/parse-fail/lex-bad-binary-literal.rs b/src/test/parse-fail/lex-bad-binary-literal.rs
index e92000c54ba..caacb12d008 100644
--- a/src/test/parse-fail/lex-bad-binary-literal.rs
+++ b/src/test/parse-fail/lex-bad-binary-literal.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// compile-flags: -Z parse-only -Z continue-parse-after-error
+
 fn main() {
     0b121; //~ ERROR invalid digit for a base 2 literal
     0b10_10301; //~ ERROR invalid digit for a base 2 literal
diff --git a/src/test/parse-fail/lex-bad-char-literals-1.rs b/src/test/parse-fail/lex-bad-char-literals-1.rs
index 7e22a11ca97..006e3e68d8f 100644
--- a/src/test/parse-fail/lex-bad-char-literals-1.rs
+++ b/src/test/parse-fail/lex-bad-char-literals-1.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// compile-flags: -Z parse-only
+// compile-flags: -Z parse-only -Z continue-parse-after-error
 static c3: char =
     '\x1' //~ ERROR: numeric character escape is too short
 ;
diff --git a/src/test/parse-fail/lex-bad-numeric-literals.rs b/src/test/parse-fail/lex-bad-numeric-literals.rs
index cf171b694c3..bb97b037a00 100644
--- a/src/test/parse-fail/lex-bad-numeric-literals.rs
+++ b/src/test/parse-fail/lex-bad-numeric-literals.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// compile-flags: -Z parse-only
+// compile-flags: -Z parse-only -Z continue-parse-after-error
 
 fn main() {
     0o1.0; //~ ERROR: octal float literal is not supported
diff --git a/src/test/parse-fail/lex-bare-cr-string-literal-doc-comment.rs b/src/test/parse-fail/lex-bare-cr-string-literal-doc-comment.rs
index aa48144650f..f8943057543 100644
--- a/src/test/parse-fail/lex-bare-cr-string-literal-doc-comment.rs
+++ b/src/test/parse-fail/lex-bare-cr-string-literal-doc-comment.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// compile-flags: -Z parse-only
+// compile-flags: -Z parse-only -Z continue-parse-after-error
 
 // ignore-tidy-cr
 
diff --git a/src/test/parse-fail/new-unicode-escapes-4.rs b/src/test/parse-fail/new-unicode-escapes-4.rs
index fe125da1755..5615ac8df01 100644
--- a/src/test/parse-fail/new-unicode-escapes-4.rs
+++ b/src/test/parse-fail/new-unicode-escapes-4.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// compile-flags: -Z parse-only
+// compile-flags: -Z parse-only -Z continue-parse-after-error
 
 pub fn main() {
     let s = "\u{lol}";
diff --git a/src/test/parse-fail/no-unsafe-self.rs b/src/test/parse-fail/no-unsafe-self.rs
index 1cc0e62f5b2..cbdf50a7521 100644
--- a/src/test/parse-fail/no-unsafe-self.rs
+++ b/src/test/parse-fail/no-unsafe-self.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// compile-flags: -Z parse-only
+// compile-flags: -Z parse-only -Z continue-parse-after-error
 
 trait A {
     fn foo(*mut self); //~ ERROR cannot pass self by raw pointer