Skip to content

Commit ca098b1

Browse files
committed
detach submod_path from Parser
1 parent dfcefa4 commit ca098b1

File tree

2 files changed

+192
-187
lines changed

2 files changed

+192
-187
lines changed

src/librustc_parse/parser/diagnostics.rs

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use rustc_span::{MultiSpan, Span, SpanSnippetError, DUMMY_SP};
1818

1919
use log::{debug, trace};
2020
use std::mem;
21-
use std::path::PathBuf;
2221

2322
const TURBOFISH: &str = "use `::<...>` instead of `<...>` to specify type arguments";
2423

@@ -41,42 +40,12 @@ pub(super) fn dummy_arg(ident: Ident) -> Param {
4140
}
4241

4342
pub enum Error {
44-
FileNotFoundForModule { mod_name: String, default_path: PathBuf },
45-
DuplicatePaths { mod_name: String, default_path: String, secondary_path: String },
4643
UselessDocComment,
4744
}
4845

4946
impl Error {
5047
fn span_err(self, sp: impl Into<MultiSpan>, handler: &Handler) -> DiagnosticBuilder<'_> {
5148
match self {
52-
Error::FileNotFoundForModule { ref mod_name, ref default_path } => {
53-
let mut err = struct_span_err!(
54-
handler,
55-
sp,
56-
E0583,
57-
"file not found for module `{}`",
58-
mod_name,
59-
);
60-
err.help(&format!(
61-
"to create the module `{}`, create file \"{}\"",
62-
mod_name,
63-
default_path.display(),
64-
));
65-
err
66-
}
67-
Error::DuplicatePaths { ref mod_name, ref default_path, ref secondary_path } => {
68-
let mut err = struct_span_err!(
69-
handler,
70-
sp,
71-
E0584,
72-
"file for module `{}` found at both {} and {}",
73-
mod_name,
74-
default_path,
75-
secondary_path,
76-
);
77-
err.help("delete or rename one of them to remove the ambiguity");
78-
err
79-
}
8049
Error::UselessDocComment => {
8150
let mut err = struct_span_err!(
8251
handler,

0 commit comments

Comments
 (0)