diff options
| author | Joshua Nelson <jyn514@gmail.com> | 2021-03-27 22:45:01 -0400 |
|---|---|---|
| committer | Joshua Nelson <jyn514@gmail.com> | 2021-05-08 23:12:04 -0400 |
| commit | 96509b483589e8d9ae98d1c075dccef184c8be30 (patch) | |
| tree | 22249599d4466b69465b52c1d4d3720170f036e7 /compiler/rustc_parse/src | |
| parent | e49f4471aaead4317359a21d4913965f176782a6 (diff) | |
| download | rust-96509b483589e8d9ae98d1c075dccef184c8be30.tar.gz rust-96509b483589e8d9ae98d1c075dccef184c8be30.zip | |
Make `Diagnostic::span_fatal` unconditionally raise an error
It had no callers which didn't immediately call `raise()`, and this unifies the behavior with `Session`.
Diffstat (limited to 'compiler/rustc_parse/src')
| -rw-r--r-- | compiler/rustc_parse/src/lexer/mod.rs | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/compiler/rustc_parse/src/lexer/mod.rs b/compiler/rustc_parse/src/lexer/mod.rs index d3ff29a5b1a..1c2f9a9645f 100644 --- a/compiler/rustc_parse/src/lexer/mod.rs +++ b/compiler/rustc_parse/src/lexer/mod.rs @@ -148,15 +148,11 @@ impl<'a> StringReader<'a> { None => "unterminated block comment", }; let last_bpos = self.pos; - self.sess - .span_diagnostic - .struct_span_fatal_with_code( - self.mk_sp(start, last_bpos), - msg, - error_code!(E0758), - ) - .emit(); - FatalError.raise(); + self.sess.span_diagnostic.span_fatal_with_code( + self.mk_sp(start, last_bpos), + msg, + error_code!(E0758), + ); } // Skip non-doc comments |
