File tree Expand file tree Collapse file tree 2 files changed +193
-202
lines changed
src/librustc_parse/parser Expand file tree Collapse file tree 2 files changed +193
-202
lines changed Original file line number Diff line number Diff line change @@ -40,55 +40,12 @@ pub(super) fn dummy_arg(ident: Ident) -> Param {
40
40
}
41
41
42
42
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
- } ,
54
43
UselessDocComment ,
55
44
}
56
45
57
46
impl Error {
58
47
fn span_err ( self , sp : impl Into < MultiSpan > , handler : & Handler ) -> DiagnosticBuilder < ' _ > {
59
48
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
- }
92
49
Error :: UselessDocComment => {
93
50
let mut err = struct_span_err ! (
94
51
handler,
You can’t perform that action at this time.
0 commit comments