about summary refs log tree commit diff
path: root/src/librustc_parse/parser/module.rs
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-12-30 14:56:57 +0100
committerMazdak Farrokhzad <twingoow@gmail.com>2019-12-31 04:33:34 +0100
commit2091062bf685ec2a64cafdffb72ae8479ff41890 (patch)
tree37291c371ab32228e62b351b43f04fd13e8b474c /src/librustc_parse/parser/module.rs
parenta9dd56ff9a08d74c53d5cc22d18f126a12749608 (diff)
downloadrust-2091062bf685ec2a64cafdffb72ae8479ff41890.tar.gz
rust-2091062bf685ec2a64cafdffb72ae8479ff41890.zip
parser: call .struct_span_err directly
Diffstat (limited to 'src/librustc_parse/parser/module.rs')
-rw-r--r--src/librustc_parse/parser/module.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/librustc_parse/parser/module.rs b/src/librustc_parse/parser/module.rs
index 3f54e0b6de0..7f5104d260d 100644
--- a/src/librustc_parse/parser/module.rs
+++ b/src/librustc_parse/parser/module.rs
@@ -129,7 +129,7 @@ impl<'a> Parser<'a> {
             DirectoryOwnership::UnownedViaBlock => {
                 let msg = "Cannot declare a non-inline module inside a block \
                     unless it has a path attribute";
-                let mut err = self.diagnostic().struct_span_err(id_sp, msg);
+                let mut err = self.struct_span_err(id_sp, msg);
                 if paths.path_exists {
                     let msg = format!(
                         "Maybe `use` the module `{}` instead of redeclaring it",
@@ -140,9 +140,8 @@ impl<'a> Parser<'a> {
                 Err(err)
             }
             DirectoryOwnership::UnownedViaMod => {
-                let mut err = self
-                    .diagnostic()
-                    .struct_span_err(id_sp, "cannot declare a new module at this location");
+                let mut err =
+                    self.struct_span_err(id_sp, "cannot declare a new module at this location");
                 if !id_sp.is_dummy() {
                     let src_path = self.sess.source_map().span_to_filename(id_sp);
                     if let FileName::Real(src_path) = src_path {