summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_error_codes/src/error_codes/E0584.md
blob: 8b00655ee78cfae4bb6d86bce9ce771c5c9795a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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();
}
```