@@ -37,7 +37,7 @@ pub enum ModError<'a> {
37
37
CircularInclusion ( Vec < PathBuf > ) ,
38
38
ModInBlock ( Option < Ident > ) ,
39
39
FileNotFound ( Ident , PathBuf ) ,
40
- MultipleCandidates ( Ident , String , String ) ,
40
+ MultipleCandidates ( Ident , PathBuf , PathBuf ) ,
41
41
ParserError ( DiagnosticBuilder < ' a > ) ,
42
42
}
43
43
@@ -220,9 +220,7 @@ pub fn default_submod_path<'a>(
220
220
dir_ownership : DirOwnership :: Owned { relative : None } ,
221
221
} ) ,
222
222
( false , false ) => Err ( ModError :: FileNotFound ( ident, default_path) ) ,
223
- ( true , true ) => {
224
- Err ( ModError :: MultipleCandidates ( ident, default_path_str, secondary_path_str) )
225
- }
223
+ ( true , true ) => Err ( ModError :: MultipleCandidates ( ident, default_path, secondary_path) ) ,
226
224
}
227
225
}
228
226
@@ -264,15 +262,15 @@ impl ModError<'_> {
264
262
) ) ;
265
263
err
266
264
}
267
- ModError :: MultipleCandidates ( ident, default_path_short , secondary_path_short ) => {
265
+ ModError :: MultipleCandidates ( ident, default_path , secondary_path ) => {
268
266
let mut err = struct_span_err ! (
269
267
diag,
270
268
span,
271
269
E0761 ,
272
270
"file for module `{}` found at both \" {}\" and \" {}\" " ,
273
271
ident,
274
- default_path_short ,
275
- secondary_path_short ,
272
+ default_path . display ( ) ,
273
+ secondary_path . display ( ) ,
276
274
) ;
277
275
err. help ( "delete or rename one of them to remove the ambiguity" ) ;
278
276
err
0 commit comments