rust/src/libsyntax
bors 38fa82a314 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
2016-08-19 18:14:53 -07:00
..
diagnostics Rollup merge of #34385 - cgswords:tstream, r=nrc 2016-06-26 02:11:59 +00:00
ext Auto merge of #35538 - cgswords:libproc_macro, r=nrc 2016-08-16 16:35:10 -07:00
parse Auto merge of #33922 - estebank:doc-comment, r=alexcrichton 2016-08-19 18:14:53 -07:00
print Minor fixups based on feedback 2016-08-13 21:37:09 +08:00
util Factor the RefCell out of the Interner. 2016-07-11 22:25:08 +00:00
abi.rs [breaking-change] don't glob import/export syntax::abi enum variants 2016-02-11 12:34:48 +01:00
ast.rs Rename empty/bang to never 2016-08-13 21:37:09 +08:00
attr.rs Adressed PR comments. 2016-07-25 14:27:10 -07:00
Cargo.toml Fix Cargo.tomls 2016-06-27 18:30:46 +00:00
codemap.rs Reimplemented tokenstreams as ropes and reduced the exposed TokenStream API. 2016-08-01 10:42:22 -07:00
config.rs Avoid processing features on unconfigured crates. 2016-07-21 23:03:01 +00:00
diagnostic_list.rs Move E0533 to E0558 (because of external change) 2016-07-11 23:27:27 +02:00
entry.rs [breaking-change] don't glob export ast::Item_ variants 2016-02-11 12:34:48 +01:00
feature_gate.rs Auto merge of #35162 - canndrew:bang_type_coerced, r=nikomatsakis 2016-08-16 00:12:12 -07:00
fold.rs Rename empty/bang to never 2016-08-13 21:37:09 +08:00
json.rs Rename emit_struct->emit 2016-07-14 07:57:46 -04:00
lib.rs Proc_macro is alive 2016-08-16 13:17:36 -07:00
ptr.rs Remove some old code from libsyntax 2016-04-24 21:04:09 +03:00
show_span.rs Remove the type parameter from syntax::visit::Visitor 2016-06-14 07:40:32 +00:00
std_inject.rs Move errors from libsyntax to its own crate 2016-06-23 08:07:35 -04:00
str.rs syntax: Copy unstable str::char_at into libsyntax 2015-04-21 10:23:53 -07:00
test.rs Auto merge of #34789 - jonathandturner:simplify_liberror, r=alexcrichton 2016-07-17 00:06:29 -07:00
tokenstream.rs Auto merge of #35538 - cgswords:libproc_macro, r=nrc 2016-08-16 16:35:10 -07:00
visit.rs Minor fixup. 2016-08-13 21:37:09 +08:00