Skip to content

Commit 996449b

Browse files
committed
detach submod_path from Parser
1 parent cbcb550 commit 996449b

File tree

2 files changed

+193
-202
lines changed

2 files changed

+193
-202
lines changed

src/librustc_parse/parser/diagnostics.rs

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -40,55 +40,12 @@ pub(super) fn dummy_arg(ident: Ident) -> Param {
4040
}
4141

4242
pub enum Error {
43-
FileNotFoundForModule {
44-
mod_name: String,
45-
default_path: String,
46-
secondary_path: String,
47-
dir_path: String,
48-
},
49-
DuplicatePaths {
50-
mod_name: String,
51-
default_path: String,
52-
secondary_path: String,
53-
},
5443
UselessDocComment,
5544
}
5645

5746
impl Error {
5847
fn span_err(self, sp: impl Into<MultiSpan>, handler: &Handler) -> DiagnosticBuilder<'_> {
5948
match self {
60-
Error::FileNotFoundForModule {
61-
ref mod_name,
62-
ref default_path,
63-
ref secondary_path,
64-
ref dir_path,
65-
} => {
66-
let mut err = struct_span_err!(
67-
handler,
68-
sp,
69-
E0583,
70-
"file not found for module `{}`",
71-
mod_name,
72-
);
73-
err.help(&format!(
74-
"name the file either {} or {} inside the directory \"{}\"",
75-
default_path, secondary_path, dir_path,
76-
));
77-
err
78-
}
79-
Error::DuplicatePaths { ref mod_name, ref default_path, ref secondary_path } => {
80-
let mut err = struct_span_err!(
81-
handler,
82-
sp,
83-
E0584,
84-
"file for module `{}` found at both {} and {}",
85-
mod_name,
86-
default_path,
87-
secondary_path,
88-
);
89-
err.help("delete or rename one of them to remove the ambiguity");
90-
err
91-
}
9249
Error::UselessDocComment => {
9350
let mut err = struct_span_err!(
9451
handler,

0 commit comments

Comments
 (0)