Rollup merge of #73122 - doctorn:issue-73116, r=varkor
Resolve E0584 conflict Adds a new error code (`E0761`) to indicate ambiguity in module file names and an accompanying expanded description to resolve a conflict over `E0584`. Resolves #73116
This commit is contained in:
commit
95479d4905
5 changed files with 30 additions and 4 deletions
|
@ -439,6 +439,7 @@ E0753: include_str!("./error_codes/E0753.md"),
|
||||||
E0754: include_str!("./error_codes/E0754.md"),
|
E0754: include_str!("./error_codes/E0754.md"),
|
||||||
E0758: include_str!("./error_codes/E0758.md"),
|
E0758: include_str!("./error_codes/E0758.md"),
|
||||||
E0760: include_str!("./error_codes/E0760.md"),
|
E0760: include_str!("./error_codes/E0760.md"),
|
||||||
|
E0761: include_str!("./error_codes/E0761.md"),
|
||||||
;
|
;
|
||||||
// E0006, // merged with E0005
|
// E0006, // merged with E0005
|
||||||
// E0008, // cannot bind by-move into a pattern guard
|
// E0008, // cannot bind by-move into a pattern guard
|
||||||
|
|
|
@ -2,7 +2,7 @@ A file wasn't found for an out-of-line module.
|
||||||
|
|
||||||
Erroneous code example:
|
Erroneous code example:
|
||||||
|
|
||||||
```ignore (compile_fail not working here; see Issue #43707)
|
```compile_fail,E0583
|
||||||
mod file_that_doesnt_exist; // error: file not found for module
|
mod file_that_doesnt_exist; // error: file not found for module
|
||||||
|
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
25
src/librustc_error_codes/error_codes/E0761.md
Normal file
25
src/librustc_error_codes/error_codes/E0761.md
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
Multiple candidate files were found for an out-of-line module.
|
||||||
|
|
||||||
|
Erroneous code example:
|
||||||
|
|
||||||
|
```rust
|
||||||
|
// file: ambiguous_module/mod.rs
|
||||||
|
|
||||||
|
fn foo() {}
|
||||||
|
```
|
||||||
|
|
||||||
|
```rust
|
||||||
|
// file: ambiguous_module.rs
|
||||||
|
|
||||||
|
fn foo() {}
|
||||||
|
```
|
||||||
|
|
||||||
|
```ignore (multiple source files required for compile_fail)
|
||||||
|
mod ambiguous_module; // error: file for module `ambiguous_module`
|
||||||
|
// found at both ambiguous_module.rs and
|
||||||
|
// ambiguous_module.rs/mod.rs
|
||||||
|
|
||||||
|
fn main() {}
|
||||||
|
```
|
||||||
|
|
||||||
|
Please remove this ambiguity by deleting/renaming one of the candidate files.
|
|
@ -291,7 +291,7 @@ pub fn default_submod_path<'a>(
|
||||||
let mut err = struct_span_err!(
|
let mut err = struct_span_err!(
|
||||||
sess.span_diagnostic,
|
sess.span_diagnostic,
|
||||||
span,
|
span,
|
||||||
E0584,
|
E0761,
|
||||||
"file for module `{}` found at both {} and {}",
|
"file for module `{}` found at both {} and {}",
|
||||||
mod_name,
|
mod_name,
|
||||||
default_path_str,
|
default_path_str,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
error[E0584]: file for module `mod_file_disambig_aux` found at both mod_file_disambig_aux.rs and mod_file_disambig_aux/mod.rs
|
error[E0761]: file for module `mod_file_disambig_aux` found at both mod_file_disambig_aux.rs and mod_file_disambig_aux/mod.rs
|
||||||
--> $DIR/mod_file_disambig.rs:1:1
|
--> $DIR/mod_file_disambig.rs:1:1
|
||||||
|
|
|
|
||||||
LL | mod mod_file_disambig_aux;
|
LL | mod mod_file_disambig_aux;
|
||||||
|
@ -14,5 +14,5 @@ LL | assert_eq!(mod_file_aux::bar(), 10);
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
Some errors have detailed explanations: E0433, E0584.
|
Some errors have detailed explanations: E0433, E0761.
|
||||||
For more information about an error, try `rustc --explain E0433`.
|
For more information about an error, try `rustc --explain E0433`.
|
||||||
|
|
Loading…
Add table
Reference in a new issue