about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-03-17 22:55:00 +0100
committerGitHub <noreply@github.com>2022-03-17 22:55:00 +0100
commit7e1415ea80bedaf5b27900aaecc0d5cbc8ce7434 (patch)
tree360eb126ee5345c31a10314d676f6c18e0fd98e7 /compiler/rustc_parse/src/parser
parentc8133f6f5e7de007e2568a3ef8fbb2e96075411e (diff)
parentbb8d4307eb723850e98bcb52d71d860a4aba220a (diff)
downloadrust-7e1415ea80bedaf5b27900aaecc0d5cbc8ce7434.tar.gz
rust-7e1415ea80bedaf5b27900aaecc0d5cbc8ce7434.zip
Rollup merge of #93222 - mark-i-m:errorreported, r=oli-obk
Make ErrorReported impossible to construct outside `rustc_errors`

There are a few places were we have to construct it, though, and a few
places that are more invasive to change. To do this, we create a
constructor with a long obvious name.

cc #69426 `@varkor` `@eddyb` `@estebank`

I actually didn't see that I was assigned to this issue until now...
Diffstat (limited to 'compiler/rustc_parse/src/parser')
-rw-r--r--compiler/rustc_parse/src/parser/item.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs
index a485d12b0c0..27e83394611 100644
--- a/compiler/rustc_parse/src/parser/item.rs
+++ b/compiler/rustc_parse/src/parser/item.rs
@@ -212,10 +212,10 @@ impl<'a> Parser<'a> {
             if let Err(mut e) = self.expect_semi() {
                 match tree.kind {
                     UseTreeKind::Glob => {
-                        e.note("the wildcard token must be last on the path").emit();
+                        e.note("the wildcard token must be last on the path");
                     }
                     UseTreeKind::Nested(..) => {
-                        e.note("glob-like brace syntax must be last on the path").emit();
+                        e.note("glob-like brace syntax must be last on the path");
                     }
                     _ => (),
                 }
@@ -1507,7 +1507,7 @@ impl<'a> Parser<'a> {
                     // Make sure an error was emitted (either by recovering an angle bracket,
                     // or by finding an identifier as the next token), since we're
                     // going to continue parsing
-                    assert!(self.sess.span_diagnostic.has_errors());
+                    assert!(self.sess.span_diagnostic.has_errors().is_some());
                 } else {
                     return Err(err);
                 }