about summary refs log tree commit diff
path: root/src/libstd/sys/unix/stdio.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-08-19 18:14:53 -0700
committerGitHub <noreply@github.com>2016-08-19 18:14:53 -0700
commit38fa82a3149a9f1428a9c760aeac7265b045fa24 (patch)
tree185e904d34c00d91e6b2631dc8ba96efc0073372 /src/libstd/sys/unix/stdio.rs
parentf883b0bbab6c433eb7b7042b605b4339022c563a (diff)
parentc8498cc2c27b699436c5f3d3759695926ee0c825 (diff)
downloadrust-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