Skip to content

Commit 41a93cb

Browse files
committed
Remove -Z continue-parse-after-error
1 parent ed6468d commit 41a93cb

36 files changed

+77
-125
lines changed

src/librustc_codegen_ssa/back/write.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1679,7 +1679,6 @@ impl SharedEmitterMain {
16791679
d.code(code);
16801680
}
16811681
handler.emit_diagnostic(&d);
1682-
handler.abort_if_errors_and_should_abort();
16831682
}
16841683
Ok(SharedEmitterMessage::InlineAsmError(cookie, msg)) => {
16851684
sess.span_err(ExpnId::from_u32(cookie).expn_data().call_site, &msg)

src/librustc_driver/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,6 @@ pub fn report_ice(info: &panic::PanicInfo<'_>, bug_report_url: &str) {
11781178
if !info.payload().is::<errors::ExplicitBug>() {
11791179
let d = errors::Diagnostic::new(errors::Level::Bug, "unexpected panic");
11801180
handler.emit_diagnostic(&d);
1181-
handler.abort_if_errors_and_should_abort();
11821181
}
11831182

11841183
let mut xs: Vec<Cow<'static, str>> = vec![

src/librustc_errors/lib.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@ struct HandlerInner {
278278
err_count: usize,
279279
deduplicated_err_count: usize,
280280
emitter: Box<dyn Emitter + sync::Send>,
281-
continue_after_error: bool,
282281
delayed_span_bugs: Vec<Diagnostic>,
283282

284283
/// This set contains the `DiagnosticId` of all emitted diagnostics to avoid
@@ -402,7 +401,6 @@ impl Handler {
402401
err_count: 0,
403402
deduplicated_err_count: 0,
404403
emitter,
405-
continue_after_error: true,
406404
delayed_span_bugs: Vec::new(),
407405
taught_diagnostics: Default::default(),
408406
emitted_diagnostic_codes: Default::default(),
@@ -412,10 +410,6 @@ impl Handler {
412410
}
413411
}
414412

415-
pub fn set_continue_after_error(&self, continue_after_error: bool) {
416-
self.inner.borrow_mut().continue_after_error = continue_after_error;
417-
}
418-
419413
// This is here to not allow mutation of flags;
420414
// as of this writing it's only used in tests in librustc.
421415
pub fn can_emit_warnings(&self) -> bool {
@@ -672,10 +666,6 @@ impl Handler {
672666
self.inner.borrow_mut().abort_if_errors()
673667
}
674668

675-
pub fn abort_if_errors_and_should_abort(&self) {
676-
self.inner.borrow_mut().abort_if_errors_and_should_abort()
677-
}
678-
679669
/// `true` if we haven't taught a diagnostic with this code already.
680670
/// The caller must then teach the user about such a diagnostic.
681671
///
@@ -696,7 +686,6 @@ impl Handler {
696686
fn emit_diag_at_span(&self, mut diag: Diagnostic, sp: impl Into<MultiSpan>) {
697687
let mut inner = self.inner.borrow_mut();
698688
inner.emit_diagnostic(diag.set_span(sp));
699-
inner.abort_if_errors_and_should_abort();
700689
}
701690

702691
pub fn emit_artifact_notification(&self, path: &Path, artifact_type: &str) {
@@ -830,14 +819,6 @@ impl HandlerInner {
830819
self.has_errors() || !self.delayed_span_bugs.is_empty()
831820
}
832821

833-
fn abort_if_errors_and_should_abort(&mut self) {
834-
self.emit_stashed_diagnostics();
835-
836-
if self.has_errors() && !self.continue_after_error {
837-
FatalError.raise();
838-
}
839-
}
840-
841822
fn abort_if_errors(&mut self) {
842823
self.emit_stashed_diagnostics();
843824

@@ -853,7 +834,6 @@ impl HandlerInner {
853834

854835
fn emit_diag_at_span(&mut self, mut diag: Diagnostic, sp: impl Into<MultiSpan>) {
855836
self.emit_diagnostic(diag.set_span(sp));
856-
self.abort_if_errors_and_should_abort();
857837
}
858838

859839
fn delay_span_bug(&mut self, sp: impl Into<MultiSpan>, msg: &str) {

src/librustc_interface/passes.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,13 @@ use std::rc::Rc;
5454
use std::{env, fs, iter, mem};
5555

5656
pub fn parse<'a>(sess: &'a Session, input: &Input) -> PResult<'a, ast::Crate> {
57-
sess.diagnostic().set_continue_after_error(sess.opts.debugging_opts.continue_parse_after_error);
5857
let krate = sess.time("parsing", || match input {
5958
Input::File(file) => parse_crate_from_file(file, &sess.parse_sess),
6059
Input::Str { input, name } => {
6160
parse_crate_from_source_str(name.clone(), input.clone(), &sess.parse_sess)
6261
}
6362
})?;
6463

65-
sess.diagnostic().set_continue_after_error(true);
66-
6764
if sess.opts.debugging_opts.ast_json_noexpand {
6865
println!("{}", json::as_json(&krate));
6966
}

src/librustc_interface/tests.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -601,10 +601,6 @@ fn test_debugging_options_tracking_hash() {
601601
opts.debugging_opts.report_delayed_bugs = true;
602602
assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());
603603

604-
opts = reference.clone();
605-
opts.debugging_opts.continue_parse_after_error = true;
606-
assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());
607-
608604
opts = reference.clone();
609605
opts.debugging_opts.force_overflow_checks = Some(true);
610606
assert!(reference.dep_tracking_hash() != opts.dep_tracking_hash());

src/librustc_session/options.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -772,8 +772,6 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
772772
"set the current terminal width"),
773773
panic_abort_tests: bool = (false, parse_bool, [TRACKED],
774774
"support compiling tests with panic=abort"),
775-
continue_parse_after_error: bool = (false, parse_bool, [TRACKED],
776-
"attempt to recover from parse errors (experimental)"),
777775
dep_tasks: bool = (false, parse_bool, [UNTRACKED],
778776
"print tasks that execute and the color their dep node gets (requires debug build)"),
779777
incremental: Option<String> = (None, parse_opt_string, [UNTRACKED],

src/test/ui/consts/miri_unleashed/mutable_const2.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ error: internal compiler error: mutable allocation in constant
1010
LL | const MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _;
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1212

13-
thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', src/librustc_errors/lib.rs:347:17
13+
thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', src/librustc_errors/lib.rs:346:17
1414
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
1515

1616
error: internal compiler error: unexpected panic

src/test/ui/parse-error-correct.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// compile-flags: -Z continue-parse-after-error
2-
31
// Test that the parser is error correcting missing idents. Despite a parsing
42
// error (or two), we still run type checking (and don't get extra errors there).
53

src/test/ui/parse-error-correct.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
error: unexpected token: `;`
2-
--> $DIR/parse-error-correct.rs:8:15
2+
--> $DIR/parse-error-correct.rs:6:15
33
|
44
LL | let x = y.;
55
| ^
66

77
error: unexpected token: `(`
8-
--> $DIR/parse-error-correct.rs:9:15
8+
--> $DIR/parse-error-correct.rs:7:15
99
|
1010
LL | let x = y.();
1111
| ^
1212

1313
error[E0618]: expected function, found `{integer}`
14-
--> $DIR/parse-error-correct.rs:9:13
14+
--> $DIR/parse-error-correct.rs:7:13
1515
|
1616
LL | let y = 42;
1717
| - `{integer}` defined here
@@ -22,7 +22,7 @@ LL | let x = y.();
2222
| call expression requires function
2323

2424
error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
25-
--> $DIR/parse-error-correct.rs:11:15
25+
--> $DIR/parse-error-correct.rs:9:15
2626
|
2727
LL | let x = y.foo;
2828
| ^^^

src/test/ui/parser-recovery-1.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// compile-flags: -Z continue-parse-after-error
2-
31
// Test that we can recover from missing braces in the parser.
42

53
trait Foo {

0 commit comments

Comments
 (0)