diff options
| author | bors <bors@rust-lang.org> | 2020-03-19 00:28:33 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-03-19 00:28:33 +0000 |
| commit | 57e1da59cd0761330b4ea8d47b16340a78eeafa9 (patch) | |
| tree | 0dc41b23dbe3fda1dbc8e69548e7060adcea0fd1 /src/librustc_parse/parser/diagnostics.rs | |
| parent | f509b26a7730d721ef87423a72b3fdf8724b4afa (diff) | |
| parent | 94ed0719f7ab083e4c94651a608ae49e14653e6a (diff) | |
| download | rust-57e1da59cd0761330b4ea8d47b16340a78eeafa9.tar.gz rust-57e1da59cd0761330b4ea8d47b16340a78eeafa9.zip | |
Auto merge of #70118 - pietroalbini:rollup-pgjc90i, r=pietroalbini
Rollup of 2 pull requests Successful merges: - #70112 (Rollup of 10 pull requests) - #70116 (ci: use python from the correct path) Failed merges: r? @ghost
Diffstat (limited to 'src/librustc_parse/parser/diagnostics.rs')
| -rw-r--r-- | src/librustc_parse/parser/diagnostics.rs | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/src/librustc_parse/parser/diagnostics.rs b/src/librustc_parse/parser/diagnostics.rs index 8e52bb16147..87255386b9e 100644 --- a/src/librustc_parse/parser/diagnostics.rs +++ b/src/librustc_parse/parser/diagnostics.rs @@ -18,7 +18,6 @@ use rustc_span::{MultiSpan, Span, SpanSnippetError, DUMMY_SP}; use log::{debug, trace}; use std::mem; -use std::path::PathBuf; const TURBOFISH: &str = "use `::<...>` instead of `<...>` to specify type arguments"; @@ -41,42 +40,12 @@ pub(super) fn dummy_arg(ident: Ident) -> Param { } pub enum Error { - FileNotFoundForModule { mod_name: String, default_path: PathBuf }, - DuplicatePaths { mod_name: String, default_path: String, secondary_path: String }, UselessDocComment, } impl Error { fn span_err(self, sp: impl Into<MultiSpan>, handler: &Handler) -> DiagnosticBuilder<'_> { match self { - Error::FileNotFoundForModule { ref mod_name, ref default_path } => { - let mut err = struct_span_err!( - handler, - sp, - E0583, - "file not found for module `{}`", - mod_name, - ); - err.help(&format!( - "to create the module `{}`, create file \"{}\"", - mod_name, - default_path.display(), - )); - err - } - Error::DuplicatePaths { ref mod_name, ref default_path, ref secondary_path } => { - let mut err = struct_span_err!( - handler, - sp, - E0584, - "file for module `{}` found at both {} and {}", - mod_name, - default_path, - secondary_path, - ); - err.help("delete or rename one of them to remove the ambiguity"); - err - } Error::UselessDocComment => { let mut err = struct_span_err!( handler, |
