diff options
| author | bors <bors@rust-lang.org> | 2018-06-12 17:37:12 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-06-12 17:37:12 +0000 |
| commit | b68432d560c7c6f1e738b27e49d271a2a778f898 (patch) | |
| tree | c5ebacbddbe0d328e88722a91f59fb9c5703b81b /src/libsyntax | |
| parent | ef8cb40c9c03fe60aac47c8736045231633dbdac (diff) | |
| parent | 398e5708918f61a2de74c334d513ea642e930181 (diff) | |
| download | rust-b68432d560c7c6f1e738b27e49d271a2a778f898.tar.gz rust-b68432d560c7c6f1e738b27e49d271a2a778f898.zip | |
Auto merge of #51521 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 3 pull requests Successful merges: - #51261 (Updated RELEASES.md for 1.27.0) - #51502 (Make parse_seq_to_end and parse_path public) - #51510 (Long diagnostic for E0538) Failed merges:
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/diagnostic_list.rs | 31 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 4 |
2 files changed, 32 insertions, 3 deletions
diff --git a/src/libsyntax/diagnostic_list.rs b/src/libsyntax/diagnostic_list.rs index 9775a6475cc..ab8317bfa02 100644 --- a/src/libsyntax/diagnostic_list.rs +++ b/src/libsyntax/diagnostic_list.rs @@ -93,6 +93,36 @@ For more information about the cfg attribute, read: https://doc.rust-lang.org/reference.html#conditional-compilation "##, +E0538: r##" +Attribute contains same meta item more than once. + +Erroneous code example: + +```compile_fail,E0538 +#[deprecated( + since="1.0.0", + note="First deprecation note.", + note="Second deprecation note." // error: multiple same meta item +)] +fn deprecated_function() {} +``` + +Meta items are the key-value pairs inside of an attribute. Each key may only be +used once in each attribute. + +To fix the problem, remove all but one of the meta items with the same key. + +Example: + +``` +#[deprecated( + since="1.0.0", + note="First deprecation note." +)] +fn deprecated_function() {} +``` +"##, + E0541: r##" An unknown meta item was used. @@ -347,7 +377,6 @@ and likely to change in the future. } register_diagnostics! { - E0538, // multiple [same] items E0539, // incorrect meta item E0540, // multiple rustc_deprecated attributes E0542, // missing 'since' diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 092564d158f..e1f920c16fd 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1022,7 +1022,7 @@ impl<'a> Parser<'a> { /// Parse a sequence, including the closing delimiter. The function /// f must consume tokens until reaching the next separator or /// closing bracket. - crate fn parse_seq_to_end<T, F>(&mut self, + pub fn parse_seq_to_end<T, F>(&mut self, ket: &token::Token, sep: SeqSep, f: F) @@ -1886,7 +1886,7 @@ impl<'a> Parser<'a> { /// `a::b::C::<D>` (with disambiguator) /// `Fn(Args)` (without disambiguator) /// `Fn::(Args)` (with disambiguator) - crate fn parse_path(&mut self, style: PathStyle) -> PResult<'a, ast::Path> { + pub fn parse_path(&mut self, style: PathStyle) -> PResult<'a, ast::Path> { self.parse_path_common(style, true) } |
