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

Add long error explanation for E0584 #65493

Merged
merged 2 commits into from
Oct 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
28 changes: 27 additions & 1 deletion src/libsyntax/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,33 @@ named `file_that_doesnt_exist.rs` or `file_that_doesnt_exist/mod.rs` in the
same directory.
"##,

E0584: r##"
A doc comment that is not attached to anything has been encountered.

Erroneous code example:

```compile_fail,E0584
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();
}
```
"##,

E0585: r##"
A documentation comment that doesn't document anything was found.

Expand Down Expand Up @@ -494,7 +521,6 @@ features in the `-Z allow_features` flag.
E0549,
E0553, // multiple rustc_const_unstable attributes
// E0555, // replaced with a generic attribute input check
E0584, // file for module `..` found at both .. and ..
E0629, // missing 'feature' (rustc_const_unstable)
// rustc_const_unstable attribute must be paired with stable/unstable
// attribute
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/mod/mod_file_disambig.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ LL | mod mod_file_disambig_aux;

error: aborting due to previous error

For more information about this error, try `rustc --explain E0584`.
1 change: 1 addition & 0 deletions src/test/ui/parser/doc-inside-trait-item.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ LL | /// empty doc

error: aborting due to previous error

For more information about this error, try `rustc --explain E0584`.