Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve E0584 conflict #73122

Merged
merged 2 commits into from
Jun 10, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/librustc_error_codes/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ E0752: include_str!("./error_codes/E0752.md"),
E0753: include_str!("./error_codes/E0753.md"),
E0754: include_str!("./error_codes/E0754.md"),
E0760: include_str!("./error_codes/E0760.md"),
E0761: include_str!("./error_codes/E0761.md"),
;
// E0006, // merged with E0005
// E0008, // cannot bind by-move into a pattern guard
Expand Down
25 changes: 25 additions & 0 deletions src/librustc_error_codes/error_codes/E0761.md
Original file line number Diff line number Diff line change
@@ -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 (compile_fail not working here; see Issue #43707)
doctorn marked this conversation as resolved.
Show resolved Hide resolved
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.
2 changes: 1 addition & 1 deletion src/librustc_expand/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ pub fn default_submod_path<'a>(
let mut err = struct_span_err!(
sess.span_diagnostic,
span,
E0584,
E0761,
"file for module `{}` found at both {} and {}",
mod_name,
default_path_str,
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/mod/mod_file_disambig.stderr
Original file line number Diff line number Diff line change
@@ -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
|
LL | mod mod_file_disambig_aux;
Expand All @@ -14,5 +14,5 @@ LL | assert_eq!(mod_file_aux::bar(), 10);

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`.