diff options
| author | kennytm <kennytm@gmail.com> | 2017-11-01 13:32:13 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-11-01 13:32:13 +0800 |
| commit | 26af3e1c4ec460703da391af037bf8c2999ea61f (patch) | |
| tree | 4c41df55053d62a46037197106b869ce3e915c3f /src/libsyntax | |
| parent | 28b18790f7dc37c83f67f3974d9e25e176b66bf4 (diff) | |
| parent | 42ef3f17841b9de7c6a405645c3c4ad8eded9ca5 (diff) | |
| download | rust-26af3e1c4ec460703da391af037bf8c2999ea61f.tar.gz rust-26af3e1c4ec460703da391af037bf8c2999ea61f.zip | |
Rollup merge of #45644 - zackmdavis:edit_disallowed_inner_attr_note, r=estebank
edit and fix bad spacing of inner-attribute-not-allowed note This multiline string literal was missing a backslash, leaving an awkward newline and 35 spaces in the middle of the message. But while we're here, the existing message seems kind of long in comparison to similar notes: to cut it down, we excise the mentions of doc comments, which seems sensible because we know that this erroneous attribute is not a doc comment (notice the `is_sugared_doc: false` at the end of the function; if it had been a doc comment, that error would get set in the `token::DocComment` match branch of `parse_outer_attributes`).
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/parse/attr.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libsyntax/parse/attr.rs b/src/libsyntax/parse/attr.rs index 48c92873e14..053746b579d 100644 --- a/src/libsyntax/parse/attr.rs +++ b/src/libsyntax/parse/attr.rs @@ -105,11 +105,10 @@ impl<'a> Parser<'a> { let span = self.span; self.diagnostic() .struct_span_err(span, reason) - .note("inner attributes and doc comments, like `#![no_std]` or \ - `//! My crate`, annotate the item enclosing them, and are \ - usually found at the beginning of source files. Outer \ - attributes and doc comments, like `#[test]` and - `/// My function`, annotate the item following them.") + .note("inner attributes, like `#![no_std]`, annotate the item \ + enclosing them, and are usually found at the beginning of \ + source files. Outer attributes, like `#[test]`, annotate the \ + item following them.") .emit() } ast::AttrStyle::Inner |
