You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
What I encountered
Hi, while learning Rust I got the following error:
I understand the issue quite well and know how to fix it, but I wanted to know whether I should use
utils.rs
orutils/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
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
:This issue has been assigned to @doctorn via this comment.
The text was updated successfully, but these errors were encountered: