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

Duplicate error E0584 in codebase #73116

Closed
Tiv0w opened this issue Jun 8, 2020 · 1 comment · Fixed by #73122
Closed

Duplicate error E0584 in codebase #73116

Tiv0w opened this issue Jun 8, 2020 · 1 comment · Fixed by #73122
Assignees
Labels
C-bug Category: This is a bug.

Comments

@Tiv0w
Copy link

Tiv0w commented Jun 8, 2020

What I encountered

Hi, while learning Rust I got the following error:

error[E0584]: file for module `utils` found at both utils.rs and utils/mod.rs
--> src/main.rs:4:1
  |
4 | mod utils;
  | ^^^^^^^^^^
  |
  = help: delete or rename one of them to remove the ambiguity

I understand the issue quite well and know how to fix it, but I wanted to know whether I should use utils.rs or utils/mod.rs as best practice.


So I tried to rustc --explain E0584 for more information.

Unfortunately, the explanation was the wrong one:

Wrong explanation block

A doc comment that is not attached to anything has been encountered.

Erroneous code example:

``
trait Island {
    fn lost();

    /// I'm lost!
}
``

A little reminder: a doc comment has to be placed before the item it's supposed
to document. So if you want to document the `Island` trait, you need to put a
doc comment before it, not inside it. Same goes for the `lost` method: the doc
comment needs to be before it:

``
/// I'm THE island!
trait Island {
    /// I'm lost!
    fn lost();
}
``


The problem

I just used the GitHub search in repository and it seems like there are 2 errors E0584, so the "multiple file for module " error is shadowed in the explanation.


Meta

rustc --version:

rustc 1.44.0 (49cae5576 2020-06-01)

This issue has been assigned to @doctorn via this comment.

@Tiv0w Tiv0w added the C-bug Category: This is a bug. label Jun 8, 2020
@doctorn
Copy link
Contributor

doctorn commented Jun 8, 2020

@rustbot claim

@rustbot rustbot self-assigned this Jun 8, 2020
@bors bors closed this as completed in 95479d4 Jun 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants