Skip to content

Commit f1d4ce4

Browse files
authored
Rollup merge of rust-lang#65493 - GuillaumeGomez:long-err-explanation-E0584, r=kinnison
Add long error explanation for E0584 Part of rust-lang#61137. r? @kinnison
2 parents 8cb6225 + f647c06 commit f1d4ce4

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

src/libsyntax/error_codes.rs

+27-1
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,33 @@ named `file_that_doesnt_exist.rs` or `file_that_doesnt_exist/mod.rs` in the
295295
same directory.
296296
"##,
297297

298+
E0584: r##"
299+
A doc comment that is not attached to anything has been encountered.
300+
301+
Erroneous code example:
302+
303+
```compile_fail,E0584
304+
trait Island {
305+
fn lost();
306+
307+
/// I'm lost!
308+
}
309+
```
310+
311+
A little reminder: a doc comment has to be placed before the item it's supposed
312+
to document. So if you want to document the `Island` trait, you need to put a
313+
doc comment before it, not inside it. Same goes for the `lost` method: the doc
314+
comment needs to be before it:
315+
316+
```
317+
/// I'm THE island!
318+
trait Island {
319+
/// I'm lost!
320+
fn lost();
321+
}
322+
```
323+
"##,
324+
298325
E0585: r##"
299326
A documentation comment that doesn't document anything was found.
300327
@@ -494,7 +521,6 @@ features in the `-Z allow_features` flag.
494521
E0549,
495522
E0553, // multiple rustc_const_unstable attributes
496523
// E0555, // replaced with a generic attribute input check
497-
E0584, // file for module `..` found at both .. and ..
498524
E0629, // missing 'feature' (rustc_const_unstable)
499525
// rustc_const_unstable attribute must be paired with stable/unstable
500526
// attribute

src/test/ui/mod/mod_file_disambig.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ LL | mod mod_file_disambig_aux;
88

99
error: aborting due to previous error
1010

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

src/test/ui/parser/doc-inside-trait-item.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ LL | /// empty doc
88

99
error: aborting due to previous error
1010

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

0 commit comments

Comments
 (0)