diff options
| author | bors <bors@rust-lang.org> | 2016-08-19 18:14:53 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-19 18:14:53 -0700 |
| commit | 38fa82a3149a9f1428a9c760aeac7265b045fa24 (patch) | |
| tree | 185e904d34c00d91e6b2631dc8ba96efc0073372 /src/libstd/sys/unix/stdio.rs | |
| parent | f883b0bbab6c433eb7b7042b605b4339022c563a (diff) | |
| parent | c8498cc2c27b699436c5f3d3759695926ee0c825 (diff) | |
| download | rust-38fa82a3149a9f1428a9c760aeac7265b045fa24.tar.gz rust-38fa82a3149a9f1428a9c760aeac7265b045fa24.zip | |
Auto merge of #33922 - estebank:doc-comment, r=alexcrichton
Specific error message for missplaced doc comments
Identify when documetation comments have been missplaced in the following places:
* After a struct element:
```rust
// file.rs:
struct X {
a: u8 /** document a */,
}
```
```bash
$ rustc file.rs
file.rs:2:11: 2:28 error: found documentation comment that doesn't
document anything
file.rs:2 a: u8 /** document a */,
^~~~~~~~~~~~~~~~~
file.rs:2:11: 2:28 help: doc comments must come before what they document,
maybe a comment was intended with `//`?
```
* As the last line of a struct:
```rust
// file.rs:
struct X {
a: u8,
/// incorrect documentation
}
```
```bash
$ rustc file.rs
file.rs:3:5: 3:27 error: found a documentation comment that doesn't
document anything
file.rs:3 /// incorrect documentation
^~~~~~~~~~~~~~~~~~~~~~
file.rs:3:5: 3:27 help: doc comments must come before what they document,
maybe a comment was intended with `//`?
```
* As the last line of a `fn`:
```rust
// file.rs:
fn main() {
let x = 1;
/// incorrect documentation
}
```
```bash
$ rustc file.rs
file.rs:3:5: 3:27 error: found a documentation comment that doesn't
document anything
file.rs:3 /// incorrect documentation
^~~~~~~~~~~~~~~~~~~~~~
file.rs:3:5: 3:27 help: doc comments must come before what they document,
maybe a comment was intended with `//`?
```
Fix #27429, #30322
Diffstat (limited to 'src/libstd/sys/unix/stdio.rs')
0 files changed, 0 insertions, 0 deletions
