@@ -18,6 +18,7 @@ use rustc_span::{MultiSpan, Span, SpanSnippetError, DUMMY_SP};
1818
1919use log:: { debug, trace} ;
2020use std:: mem;
21+ use std:: path:: PathBuf ;
2122
2223const TURBOFISH : & str = "use `::<...>` instead of `<...>` to specify type arguments" ;
2324
@@ -40,29 +41,15 @@ pub(super) fn dummy_arg(ident: Ident) -> Param {
4041}
4142
4243pub 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- } ,
44+ FileNotFoundForModule { mod_name : String , default_path : PathBuf } ,
45+ DuplicatePaths { mod_name : String , default_path : String , secondary_path : String } ,
5446 UselessDocComment ,
5547}
5648
5749impl Error {
5850 fn span_err ( self , sp : impl Into < MultiSpan > , handler : & Handler ) -> DiagnosticBuilder < ' _ > {
5951 match self {
60- Error :: FileNotFoundForModule {
61- ref mod_name,
62- ref default_path,
63- ref secondary_path,
64- ref dir_path,
65- } => {
52+ Error :: FileNotFoundForModule { ref mod_name, ref default_path } => {
6653 let mut err = struct_span_err ! (
6754 handler,
6855 sp,
@@ -71,8 +58,9 @@ impl Error {
7158 mod_name,
7259 ) ;
7360 err. help ( & format ! (
74- "name the file either {} or {} inside the directory \" {}\" " ,
75- default_path, secondary_path, dir_path,
61+ "to create the module `{}`, create file \" {}\" " ,
62+ mod_name,
63+ default_path. display( ) ,
7664 ) ) ;
7765 err
7866 }
0 commit comments