From 1a867dc346a0b9ea5abd8a8504f1908f42ff2dd2 Mon Sep 17 00:00:00 2001 From: "Havvy (Ryan Scheel)" Date: Mon, 10 Sep 2018 15:06:49 -0700 Subject: cfg_attr_multi: Basic implementation Does not implement the warning or a feature flag. --- src/libsyntax/config.rs | 59 +++++++++++++++++++++++++++++++------------ src/libsyntax/parse/parser.rs | 2 +- 2 files changed, 44 insertions(+), 17 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/config.rs b/src/libsyntax/config.rs index a9ce2365577..7a85f628536 100644 --- a/src/libsyntax/config.rs +++ b/src/libsyntax/config.rs @@ -73,49 +73,76 @@ impl<'a> StripUnconfigured<'a> { if self.in_cfg(node.attrs()) { Some(node) } else { None } } + /// Parse and expand all `cfg_attr` attributes into a list of attributes + /// that are within each `cfg_attr` that has a true configuration predicate. + /// + /// Gives compiler warnigns if any `cfg_attr` does not contain any + /// attributes and is in the original source code. Gives compiler errors if + /// the syntax of any `cfg_attr` is incorrect. pub fn process_cfg_attrs(&mut self, node: T) -> T { node.map_attrs(|attrs| { - attrs.into_iter().filter_map(|attr| self.process_cfg_attr(attr)).collect() + attrs.into_iter().flat_map(|attr| self.process_cfg_attr(attr)).collect() }) } - fn process_cfg_attr(&mut self, attr: ast::Attribute) -> Option { + /// Parse and expand a single `cfg_attr` attribute into a list of attributes + /// when the configuration predicate is true, or otherwise expand into an + /// empty list of attributes. + /// + /// Gives a compiler warning when the `cfg_attr` contains no attribtes and + /// is in the original source file. Gives a compiler error if the syntax of + /// the attribute is incorrect + fn process_cfg_attr(&mut self, attr: ast::Attribute) -> Vec { if !attr.check_name("cfg_attr") { - return Some(attr); + return vec![attr]; } - let (cfg, path, tokens, span) = match attr.parse(self.sess, |parser| { + let (cfg_predicate, expanded_attrs) = match attr.parse(self.sess, |parser| { parser.expect(&token::OpenDelim(token::Paren))?; - let cfg = parser.parse_meta_item()?; + + let cfg_predicate = parser.parse_meta_item()?; parser.expect(&token::Comma)?; - let lo = parser.span.lo(); - let (path, tokens) = parser.parse_meta_item_unrestricted()?; - parser.eat(&token::Comma); // Optional trailing comma + + // Presumably, the majority of the time there will only be one attr. + let mut expanded_attrs = Vec::with_capacity(1); + + while !parser.check(&token::CloseDelim(token::Paren)) { + let lo = parser.span.lo(); + let (path, tokens) = parser.parse_meta_item_unrestricted()?; + expanded_attrs.push((path, tokens, parser.prev_span.with_lo(lo))); + parser.expect_one_of(&[token::Comma], &[token::CloseDelim(token::Paren)])?; + } + parser.expect(&token::CloseDelim(token::Paren))?; - Ok((cfg, path, tokens, parser.prev_span.with_lo(lo))) + Ok((cfg_predicate, expanded_attrs)) }) { Ok(result) => result, Err(mut e) => { e.emit(); - return None; + return Vec::new(); } }; - if attr::cfg_matches(&cfg, self.sess, self.features) { - self.process_cfg_attr(ast::Attribute { + if attr::cfg_matches(&cfg_predicate, self.sess, self.features) { + // We call `process_cfg_attr` recursively in case there's a + // `cfg_attr` inside of another `cfg_attr`. E.g. + // `#[cfg_attr(false, cfg_attr(true, some_attr))]`. + expanded_attrs.into_iter() + .flat_map(|(path, tokens, span)| self.process_cfg_attr(ast::Attribute { id: attr::mk_attr_id(), style: attr.style, path, tokens, is_sugared_doc: false, span, - }) + })) + .collect() } else { - None + Vec::new() } } - // Determine if a node with the given attributes should be included in this configuration. + /// Determine if a node with the given attributes should be included in this configuration. pub fn in_cfg(&mut self, attrs: &[ast::Attribute]) -> bool { attrs.iter().all(|attr| { if !is_cfg(attr) { @@ -165,7 +192,7 @@ impl<'a> StripUnconfigured<'a> { }) } - // Visit attributes on expression and statements (but not attributes on items in blocks). + /// Visit attributes on expression and statements (but not attributes on items in blocks). fn visit_expr_attrs(&mut self, attrs: &[ast::Attribute]) { // flag the offending attributes for attr in attrs.iter() { diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 5571a18b596..a5ee2b0f103 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -678,7 +678,7 @@ impl<'a> Parser<'a> { /// Expect next token to be edible or inedible token. If edible, /// then consume it; if inedible, then return without consuming /// anything. Signal a fatal error if next token is unexpected. - fn expect_one_of(&mut self, + pub fn expect_one_of(&mut self, edible: &[token::Token], inedible: &[token::Token]) -> PResult<'a, ()>{ fn tokens_to_string(tokens: &[TokenType]) -> String { -- cgit 1.4.1-3-g733a5 From 35e6c65628a537ad92a38b562a6f9e2de1887b5b Mon Sep 17 00:00:00 2001 From: "Havvy (Ryan Scheel)" Date: Thu, 4 Oct 2018 04:55:47 -0700 Subject: cfg_attr_multi: Feature gate --- .../src/language-features/cfg-attr-multi.md | 20 ++++++++++++ src/libsyntax/config.rs | 36 +++++++++++++++++++++- src/libsyntax/feature_gate.rs | 3 ++ .../cfg-attr-multi-false.rs | 1 + .../cfg-attr-multi-invalid-1.rs | 1 + .../cfg-attr-multi-invalid-1.stderr | 2 +- .../cfg-attr-multi-invalid-2.rs | 1 + .../cfg-attr-multi-invalid-2.stderr | 2 +- .../conditional-compilation/cfg-attr-multi-true.rs | 1 + .../cfg-attr-multi-true.stderr | 10 +++--- .../feature-gates/feature-gate-cfg-attr-multi-1.rs | 5 +++ .../feature-gate-cfg-attr-multi-1.stderr | 11 +++++++ .../feature-gates/feature-gate-cfg-attr-multi-2.rs | 3 ++ .../feature-gate-cfg-attr-multi-2.stderr | 11 +++++++ .../feature-gate-cfg-attr-multi-bootstrap-1.rs | 7 +++++ .../feature-gate-cfg-attr-multi-bootstrap-2.rs | 9 ++++++ 16 files changed, 115 insertions(+), 8 deletions(-) create mode 100644 src/doc/unstable-book/src/language-features/cfg-attr-multi.md create mode 100644 src/test/ui/feature-gates/feature-gate-cfg-attr-multi-1.rs create mode 100644 src/test/ui/feature-gates/feature-gate-cfg-attr-multi-1.stderr create mode 100644 src/test/ui/feature-gates/feature-gate-cfg-attr-multi-2.rs create mode 100644 src/test/ui/feature-gates/feature-gate-cfg-attr-multi-2.stderr create mode 100644 src/test/ui/feature-gates/feature-gate-cfg-attr-multi-bootstrap-1.rs create mode 100644 src/test/ui/feature-gates/feature-gate-cfg-attr-multi-bootstrap-2.rs (limited to 'src/libsyntax') diff --git a/src/doc/unstable-book/src/language-features/cfg-attr-multi.md b/src/doc/unstable-book/src/language-features/cfg-attr-multi.md new file mode 100644 index 00000000000..759a28c4f5f --- /dev/null +++ b/src/doc/unstable-book/src/language-features/cfg-attr-multi.md @@ -0,0 +1,20 @@ +# `cfg_attr_multi` + +The tracking issue for this feature is: [#555666] +The RFC for this feature is: [#2539] + +[#555666]: https://github.com/rust-lang/rust/issues/555666 +[#2539]: https://github.com/rust-lang/rfcs/pull/2539 + +------------------------ + +This feature flag lets you put multiple attributes into a `cfg_attr` attribute. + +Example: + +```rust,ignore +#[cfg_attr(all(), must_use, optimize)] +``` + +Because `cfg_attr` resolves before procedural macros, this does not affect +macro resolution at all. \ No newline at end of file diff --git a/src/libsyntax/config.rs b/src/libsyntax/config.rs index 7a85f628536..e611eb86dc1 100644 --- a/src/libsyntax/config.rs +++ b/src/libsyntax/config.rs @@ -9,7 +9,14 @@ // except according to those terms. use attr::HasAttrs; -use feature_gate::{feature_err, EXPLAIN_STMT_ATTR_SYNTAX, Features, get_features, GateIssue}; +use feature_gate::{ + feature_err, + EXPLAIN_STMT_ATTR_SYNTAX, + Features, + get_features, + GateIssue, + emit_feature_err, +}; use {fold, attr}; use ast; use source_map::Spanned; @@ -97,6 +104,13 @@ impl<'a> StripUnconfigured<'a> { return vec![attr]; } + let gate_cfg_attr_multi = if let Some(ref features) = self.features { + !features.cfg_attr_multi + } else { + false + }; + let cfg_attr_span = attr.span; + let (cfg_predicate, expanded_attrs) = match attr.parse(self.sess, |parser| { parser.expect(&token::OpenDelim(token::Paren))?; @@ -123,6 +137,26 @@ impl<'a> StripUnconfigured<'a> { } }; + // Check feature gate and lint on zero attributes in source. Even if the feature is gated, + // we still compute as if it wasn't, since the emitted error will stop compilation futher + // along the compilation. + match (expanded_attrs.len(), gate_cfg_attr_multi) { + (0, false) => { + // FIXME: Emit unused attribute lint here. + }, + (1, _) => {}, + (_, true) => { + emit_feature_err( + self.sess, + "cfg_attr_multi", + cfg_attr_span, + GateIssue::Language, + "cfg_attr with zero or more than one attributes is experimental", + ); + }, + (_, false) => {} + } + if attr::cfg_matches(&cfg_predicate, self.sess, self.features) { // We call `process_cfg_attr` recursively in case there's a // `cfg_attr` inside of another `cfg_attr`. E.g. diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index adbe2f9d439..7707bbaa8b0 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -515,6 +515,9 @@ declare_features! ( // Allows `impl Trait` in bindings (`let`, `const`, `static`) (active, impl_trait_in_bindings, "1.30.0", Some(34511), None), + + // #[cfg_attr(predicate, multiple, attributes, here)] + (active, cfg_attr_multi, "1.31.0", Some(555666), None), ); declare_features! ( diff --git a/src/test/ui/conditional-compilation/cfg-attr-multi-false.rs b/src/test/ui/conditional-compilation/cfg-attr-multi-false.rs index ff7a47e0839..84bd33fc0e7 100644 --- a/src/test/ui/conditional-compilation/cfg-attr-multi-false.rs +++ b/src/test/ui/conditional-compilation/cfg-attr-multi-false.rs @@ -4,6 +4,7 @@ // compile-pass #![warn(unused_must_use)] +#![feature(cfg_attr_multi)] #[cfg_attr(any(), deprecated, must_use)] struct Struct {} diff --git a/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-1.rs b/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-1.rs index a9ddbf7d80d..d4c3186a6eb 100644 --- a/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-1.rs +++ b/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-1.rs @@ -10,6 +10,7 @@ // // compile-flags: --cfg broken +#![feature(cfg_attr_multi)] #![cfg_attr(broken, no_core, no_std)] //~ ERROR no_core is experimental fn main() { } diff --git a/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-1.stderr b/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-1.stderr index 344a05a4fec..bf68d92cc0b 100644 --- a/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-1.stderr +++ b/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-1.stderr @@ -1,5 +1,5 @@ error[E0658]: no_core is experimental (see issue #29639) - --> $DIR/cfg-attr-multi-invalid-1.rs:13:21 + --> $DIR/cfg-attr-multi-invalid-1.rs:14:21 | LL | #![cfg_attr(broken, no_core, no_std)] //~ ERROR no_core is experimental | ^^^^^^^ diff --git a/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-2.rs b/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-2.rs index 211eb08f08e..bee6b7d4886 100644 --- a/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-2.rs +++ b/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-2.rs @@ -10,6 +10,7 @@ // // compile-flags: --cfg broken +#![feature(cfg_attr_multi)] #![cfg_attr(broken, no_std, no_core)] //~ ERROR no_core is experimental fn main() { } diff --git a/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-2.stderr b/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-2.stderr index 54854d2e29d..5c72a400e0b 100644 --- a/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-2.stderr +++ b/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-2.stderr @@ -1,5 +1,5 @@ error[E0658]: no_core is experimental (see issue #29639) - --> $DIR/cfg-attr-multi-invalid-2.rs:13:29 + --> $DIR/cfg-attr-multi-invalid-2.rs:14:29 | LL | #![cfg_attr(broken, no_std, no_core)] //~ ERROR no_core is experimental | ^^^^^^^ diff --git a/src/test/ui/conditional-compilation/cfg-attr-multi-true.rs b/src/test/ui/conditional-compilation/cfg-attr-multi-true.rs index 4b9a8d46b9b..a31dde00c7c 100644 --- a/src/test/ui/conditional-compilation/cfg-attr-multi-true.rs +++ b/src/test/ui/conditional-compilation/cfg-attr-multi-true.rs @@ -5,6 +5,7 @@ // compile-pass #![warn(unused_must_use)] +#![feature(cfg_attr_multi)] #[cfg_attr(all(), deprecated, must_use)] struct MustUseDeprecated {} diff --git a/src/test/ui/conditional-compilation/cfg-attr-multi-true.stderr b/src/test/ui/conditional-compilation/cfg-attr-multi-true.stderr index 21634ee4f26..37cb3de06c0 100644 --- a/src/test/ui/conditional-compilation/cfg-attr-multi-true.stderr +++ b/src/test/ui/conditional-compilation/cfg-attr-multi-true.stderr @@ -1,5 +1,5 @@ warning: use of deprecated item 'MustUseDeprecated' - --> $DIR/cfg-attr-multi-true.rs:12:6 + --> $DIR/cfg-attr-multi-true.rs:13:6 | LL | impl MustUseDeprecated { //~ warning: use of deprecated item | ^^^^^^^^^^^^^^^^^ @@ -7,25 +7,25 @@ LL | impl MustUseDeprecated { //~ warning: use of deprecated item = note: #[warn(deprecated)] on by default warning: use of deprecated item 'MustUseDeprecated' - --> $DIR/cfg-attr-multi-true.rs:19:5 + --> $DIR/cfg-attr-multi-true.rs:20:5 | LL | MustUseDeprecated::new(); //~ warning: use of deprecated item | ^^^^^^^^^^^^^^^^^^^^^^ warning: use of deprecated item 'MustUseDeprecated' - --> $DIR/cfg-attr-multi-true.rs:13:17 + --> $DIR/cfg-attr-multi-true.rs:14:17 | LL | fn new() -> MustUseDeprecated { //~ warning: use of deprecated item | ^^^^^^^^^^^^^^^^^ warning: use of deprecated item 'MustUseDeprecated' - --> $DIR/cfg-attr-multi-true.rs:14:9 + --> $DIR/cfg-attr-multi-true.rs:15:9 | LL | MustUseDeprecated {} //~ warning: use of deprecated item | ^^^^^^^^^^^^^^^^^ warning: unused `MustUseDeprecated` which must be used - --> $DIR/cfg-attr-multi-true.rs:19:5 + --> $DIR/cfg-attr-multi-true.rs:20:5 | LL | MustUseDeprecated::new(); //~ warning: use of deprecated item | ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/feature-gates/feature-gate-cfg-attr-multi-1.rs b/src/test/ui/feature-gates/feature-gate-cfg-attr-multi-1.rs new file mode 100644 index 00000000000..9515380bc28 --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-cfg-attr-multi-1.rs @@ -0,0 +1,5 @@ +// gate-test-cfg_attr_multi + +#![cfg_attr(all(), warn(nonstandard_style), allow(unused_attributes))] +//~^ ERROR cfg_attr with zero or more than one attributes is experimental +fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-cfg-attr-multi-1.stderr b/src/test/ui/feature-gates/feature-gate-cfg-attr-multi-1.stderr new file mode 100644 index 00000000000..23c09c913f4 --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-cfg-attr-multi-1.stderr @@ -0,0 +1,11 @@ +error[E0658]: cfg_attr with zero or more than one attributes is experimental (see issue #555666) + --> $DIR/feature-gate-cfg-attr-multi-1.rs:3:1 + | +LL | #![cfg_attr(all(), warn(nonstandard_style), allow(unused_attributes))] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(cfg_attr_multi)] to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/feature-gates/feature-gate-cfg-attr-multi-2.rs b/src/test/ui/feature-gates/feature-gate-cfg-attr-multi-2.rs new file mode 100644 index 00000000000..cf02432274b --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-cfg-attr-multi-2.rs @@ -0,0 +1,3 @@ +#![cfg_attr(all(),)] +//~^ ERROR cfg_attr with zero or more than one attributes is experimental +fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-cfg-attr-multi-2.stderr b/src/test/ui/feature-gates/feature-gate-cfg-attr-multi-2.stderr new file mode 100644 index 00000000000..d8f4acd12d7 --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-cfg-attr-multi-2.stderr @@ -0,0 +1,11 @@ +error[E0658]: cfg_attr with zero or more than one attributes is experimental (see issue #555666) + --> $DIR/feature-gate-cfg-attr-multi-2.rs:1:1 + | +LL | #![cfg_attr(all(),)] + | ^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(cfg_attr_multi)] to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/feature-gates/feature-gate-cfg-attr-multi-bootstrap-1.rs b/src/test/ui/feature-gates/feature-gate-cfg-attr-multi-bootstrap-1.rs new file mode 100644 index 00000000000..e4737926e7a --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-cfg-attr-multi-bootstrap-1.rs @@ -0,0 +1,7 @@ +// Test that settingt the featute gate while using its functionality doesn't error. + +// compile-pass + +#![cfg_attr(all(), feature(cfg_attr_multi), crate_type="bin")] + +fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-cfg-attr-multi-bootstrap-2.rs b/src/test/ui/feature-gates/feature-gate-cfg-attr-multi-bootstrap-2.rs new file mode 100644 index 00000000000..df740541f55 --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-cfg-attr-multi-bootstrap-2.rs @@ -0,0 +1,9 @@ +// Test that settingt the featute gate while using its functionality doesn't error. +// Specifically, if there's a cfg-attr *before* the feature gate. + +// compile-pass + +#![cfg_attr(all(),)] +#![cfg_attr(all(), feature(cfg_attr_multi), crate_type="bin")] + +fn main() {} -- cgit 1.4.1-3-g733a5 From b7248d5988ae4a4498fd900482142151e3ddddd2 Mon Sep 17 00:00:00 2001 From: Donato Sciarra Date: Sun, 7 Oct 2018 00:05:42 +0200 Subject: Fix internal compiler error on malformed match arm pattern. Issue: 54379 --- src/libsyntax/parse/parser.rs | 3 +++ src/test/ui/resolve/issue-54379.rs | 21 +++++++++++++++++++++ src/test/ui/resolve/issue-54379.stderr | 24 ++++++++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 src/test/ui/resolve/issue-54379.rs create mode 100644 src/test/ui/resolve/issue-54379.stderr (limited to 'src/libsyntax') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index d653ed819fd..03decd58451 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -3866,6 +3866,9 @@ impl<'a> Parser<'a> { // check that a comma comes after every field if !ate_comma { let err = self.struct_span_err(self.prev_span, "expected `,`"); + if let Some(mut delayed) = delayed_err { + delayed.emit(); + } return Err(err); } ate_comma = false; diff --git a/src/test/ui/resolve/issue-54379.rs b/src/test/ui/resolve/issue-54379.rs new file mode 100644 index 00000000000..24aa758ea6c --- /dev/null +++ b/src/test/ui/resolve/issue-54379.rs @@ -0,0 +1,21 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. +struct MyStruct { + pub s1: Option, +} + +fn main() { + let thing = MyStruct { s1: None }; + + match thing { + MyStruct { .., Some(_) } => {}, + _ => {} + } +} diff --git a/src/test/ui/resolve/issue-54379.stderr b/src/test/ui/resolve/issue-54379.stderr new file mode 100644 index 00000000000..d1d693a3817 --- /dev/null +++ b/src/test/ui/resolve/issue-54379.stderr @@ -0,0 +1,24 @@ +error: expected `}`, found `,` + --> $DIR/issue-54379.rs:18:22 + | +LL | MyStruct { .., Some(_) } => {}, + | --^ + | | | + | | expected `}` + | `..` must be at the end and cannot have a trailing comma + +error: expected `,` + --> $DIR/issue-54379.rs:18:24 + | +LL | MyStruct { .., Some(_) } => {}, + | ^^^^ + +error[E0027]: pattern does not mention field `s1` + --> $DIR/issue-54379.rs:18:9 + | +LL | MyStruct { .., Some(_) } => {}, + | ^^^^^^^^^^^^^^^^^^^^^^^^ missing field `s1` + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0027`. -- cgit 1.4.1-3-g733a5 From bbe832d570e826b2012c09869aa77d6201932730 Mon Sep 17 00:00:00 2001 From: "Havvy (Ryan Scheel)" Date: Sun, 7 Oct 2018 21:48:28 -0700 Subject: cfg-attr-multi: Change issue number to actual tracking issue --- src/doc/unstable-book/src/language-features/cfg-attr-multi.md | 4 ++-- src/libsyntax/feature_gate.rs | 2 +- src/test/ui/feature-gates/feature-gate-cfg-attr-multi-1.stderr | 2 +- src/test/ui/feature-gates/feature-gate-cfg-attr-multi-2.stderr | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/libsyntax') diff --git a/src/doc/unstable-book/src/language-features/cfg-attr-multi.md b/src/doc/unstable-book/src/language-features/cfg-attr-multi.md index 759a28c4f5f..6365d3e71c6 100644 --- a/src/doc/unstable-book/src/language-features/cfg-attr-multi.md +++ b/src/doc/unstable-book/src/language-features/cfg-attr-multi.md @@ -1,9 +1,9 @@ # `cfg_attr_multi` -The tracking issue for this feature is: [#555666] +The tracking issue for this feature is: [#54881] The RFC for this feature is: [#2539] -[#555666]: https://github.com/rust-lang/rust/issues/555666 +[#54881]: https://github.com/rust-lang/rust/issues/54881 [#2539]: https://github.com/rust-lang/rfcs/pull/2539 ------------------------ diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 7707bbaa8b0..276b0623a1f 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -517,7 +517,7 @@ declare_features! ( (active, impl_trait_in_bindings, "1.30.0", Some(34511), None), // #[cfg_attr(predicate, multiple, attributes, here)] - (active, cfg_attr_multi, "1.31.0", Some(555666), None), + (active, cfg_attr_multi, "1.31.0", Some(54881), None), ); declare_features! ( diff --git a/src/test/ui/feature-gates/feature-gate-cfg-attr-multi-1.stderr b/src/test/ui/feature-gates/feature-gate-cfg-attr-multi-1.stderr index 23c09c913f4..088e6df1a1a 100644 --- a/src/test/ui/feature-gates/feature-gate-cfg-attr-multi-1.stderr +++ b/src/test/ui/feature-gates/feature-gate-cfg-attr-multi-1.stderr @@ -1,4 +1,4 @@ -error[E0658]: cfg_attr with zero or more than one attributes is experimental (see issue #555666) +error[E0658]: cfg_attr with zero or more than one attributes is experimental (see issue #54881) --> $DIR/feature-gate-cfg-attr-multi-1.rs:3:1 | LL | #![cfg_attr(all(), warn(nonstandard_style), allow(unused_attributes))] diff --git a/src/test/ui/feature-gates/feature-gate-cfg-attr-multi-2.stderr b/src/test/ui/feature-gates/feature-gate-cfg-attr-multi-2.stderr index d8f4acd12d7..a01876114dd 100644 --- a/src/test/ui/feature-gates/feature-gate-cfg-attr-multi-2.stderr +++ b/src/test/ui/feature-gates/feature-gate-cfg-attr-multi-2.stderr @@ -1,4 +1,4 @@ -error[E0658]: cfg_attr with zero or more than one attributes is experimental (see issue #555666) +error[E0658]: cfg_attr with zero or more than one attributes is experimental (see issue #54881) --> $DIR/feature-gate-cfg-attr-multi-2.rs:1:1 | LL | #![cfg_attr(all(),)] -- cgit 1.4.1-3-g733a5 From dc2343c1a8d89cda5012bac175cca9901dd09db9 Mon Sep 17 00:00:00 2001 From: flip1995 Date: Tue, 2 Oct 2018 10:37:56 +0200 Subject: Update feature-gate listing --- src/libsyntax/feature_gate.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 24ee2464055..4ddbaee5aa4 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -433,9 +433,6 @@ declare_features! ( // #[doc(alias = "...")] (active, doc_alias, "1.27.0", Some(50146), None), - // Scoped lints - (active, tool_lints, "1.28.0", Some(44690), None), - // Allows irrefutable patterns in if-let and while-let statements (RFC 2086) (active, irrefutable_let_patterns, "1.27.0", Some(44495), None), @@ -679,6 +676,8 @@ declare_features! ( (accepted, pattern_parentheses, "1.31.0", Some(51087), None), // Allows the definition of `const fn` functions. (accepted, min_const_fn, "1.31.0", Some(53555), None), + // Scoped lints + (accepted, tool_lints, "1.31.0", Some(44690), None), ); // If you change this, please modify src/doc/unstable-book as well. You must -- cgit 1.4.1-3-g733a5