From 7bc5c8ef217249cddc007e9951405490b343d5a1 Mon Sep 17 00:00:00 2001 From: Caio Date: Thu, 22 Aug 2019 15:16:24 -0300 Subject: [PATCH] Stabilize `param_attrs` in Rust 1.39.0 --- .../src/language-features/param-attrs.md | 27 ----- src/libsyntax/feature_gate.rs | 6 +- src/test/ui/lint/lint-unused-mut-variables.rs | 2 +- src/test/ui/lint/lint-unused-variables.rs | 2 +- src/test/ui/parser/fn-arg-doc-comment.rs | 4 - src/test/ui/parser/fn-arg-doc-comment.stderr | 33 ++---- .../rfc-2565-param-attrs/param-attrs-2018.rs | 2 - .../param-attrs-2018.stderr | 2 +- .../param-attrs-allowed.rs | 1 - .../param-attrs-builtin-attrs.rs | 2 - .../param-attrs-builtin-attrs.stderr | 104 +++++++++--------- .../rfc-2565-param-attrs/param-attrs-cfg.rs | 2 +- .../param-attrs-feature-gate.rs | 4 - .../param-attrs-feature-gate.stderr | 21 +--- .../param-attrs-pretty.rs | 1 - 15 files changed, 66 insertions(+), 147 deletions(-) delete mode 100644 src/doc/unstable-book/src/language-features/param-attrs.md diff --git a/src/doc/unstable-book/src/language-features/param-attrs.md b/src/doc/unstable-book/src/language-features/param-attrs.md deleted file mode 100644 index 4b83c204ba105..0000000000000 --- a/src/doc/unstable-book/src/language-features/param-attrs.md +++ /dev/null @@ -1,27 +0,0 @@ -# `param_attrs` - -The tracking issue for this feature is: [#60406] - -[#60406]: https://github.com/rust-lang/rust/issues/60406 - -Allow attributes in formal function parameter position so external tools and compiler internals can -take advantage of the additional information that the parameters provide. - -Enables finer conditional compilation with `#[cfg(..)]` and linting control of variables. Moreover, -opens the path to richer DSLs created by users. - ------------------------- - -Example: - -```rust -#![feature(param_attrs)] - -fn len( - #[cfg(windows)] slice: &[u16], - #[cfg(not(windows))] slice: &[u8], -) -> usize -{ - slice.len() -} -``` diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index fad4f3da3de70..54a78074c4e19 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -523,9 +523,6 @@ declare_features! ( // Allows the user of associated type bounds. (active, associated_type_bounds, "1.34.0", Some(52662), None), - // Attributes on formal function params. - (active, param_attrs, "1.36.0", Some(60406), None), - // Allows calling constructor functions in `const fn`. (active, const_constructor, "1.37.0", Some(61456), None), @@ -856,6 +853,8 @@ declare_features! ( (accepted, underscore_const_names, "1.37.0", Some(54912), None), // Allows free and inherent `async fn`s, `async` blocks, and `.await` expressions. (accepted, async_await, "1.39.0", Some(50547), None), + // Attributes on formal function params. + (accepted, param_attrs, "1.39.0", Some(60406), None), // ------------------------------------------------------------------------- // feature-group-end: accepted features @@ -2431,7 +2430,6 @@ pub fn check_crate(krate: &ast::Crate, } } - gate_all!(param_attrs, "attributes on function parameters are unstable"); gate_all!(let_chains, "`let` expressions in this position are experimental"); gate_all!(async_closure, "async closures are unstable"); gate_all!(yields, generators, "yield syntax is experimental"); diff --git a/src/test/ui/lint/lint-unused-mut-variables.rs b/src/test/ui/lint/lint-unused-mut-variables.rs index f140546b04819..1af44ecf362bf 100644 --- a/src/test/ui/lint/lint-unused-mut-variables.rs +++ b/src/test/ui/lint/lint-unused-mut-variables.rs @@ -3,7 +3,7 @@ // Exercise the unused_mut attribute in some positive and negative cases #![deny(unused_mut)] -#![feature(async_closure, param_attrs)] +#![feature(async_closure)] async fn baz_async( mut a: i32, diff --git a/src/test/ui/lint/lint-unused-variables.rs b/src/test/ui/lint/lint-unused-variables.rs index 06b818636f956..1a6b5183f0fae 100644 --- a/src/test/ui/lint/lint-unused-variables.rs +++ b/src/test/ui/lint/lint-unused-variables.rs @@ -1,7 +1,7 @@ // compile-flags: --cfg something // edition:2018 -#![feature(async_closure, param_attrs)] +#![feature(async_closure)] #![deny(unused_variables)] async fn foo_async( diff --git a/src/test/ui/parser/fn-arg-doc-comment.rs b/src/test/ui/parser/fn-arg-doc-comment.rs index 4a4f959e21353..995eb62d0bb59 100644 --- a/src/test/ui/parser/fn-arg-doc-comment.rs +++ b/src/test/ui/parser/fn-arg-doc-comment.rs @@ -2,14 +2,10 @@ pub fn f( /// Comment //~^ ERROR documentation comments cannot be applied to function parameters //~| NOTE doc comments are not allowed here - //~| ERROR attributes on function parameters are unstable - //~| NOTE https://github.com/rust-lang/rust/issues/60406 id: u8, /// Other //~^ ERROR documentation comments cannot be applied to function parameters //~| NOTE doc comments are not allowed here - //~| ERROR attributes on function parameters are unstable - //~| NOTE https://github.com/rust-lang/rust/issues/60406 a: u8, ) {} diff --git a/src/test/ui/parser/fn-arg-doc-comment.stderr b/src/test/ui/parser/fn-arg-doc-comment.stderr index d8884de1fe84d..669785af45f93 100644 --- a/src/test/ui/parser/fn-arg-doc-comment.stderr +++ b/src/test/ui/parser/fn-arg-doc-comment.stderr @@ -1,5 +1,5 @@ error: attributes cannot be applied to a function parameter's type - --> $DIR/fn-arg-doc-comment.rs:16:12 + --> $DIR/fn-arg-doc-comment.rs:12:12 | LL | fn bar(id: #[allow(dead_code)] i32) {} | ^^^^^^^^^^^^^^^^^^^ attributes are not allowed here @@ -11,31 +11,13 @@ LL | /// Comment | ^^^^^^^^^^^ doc comments are not allowed here error: documentation comments cannot be applied to function parameters - --> $DIR/fn-arg-doc-comment.rs:8:5 + --> $DIR/fn-arg-doc-comment.rs:6:5 | LL | /// Other | ^^^^^^^^^ doc comments are not allowed here -error[E0658]: attributes on function parameters are unstable - --> $DIR/fn-arg-doc-comment.rs:2:5 - | -LL | /// Comment - | ^^^^^^^^^^^ - | - = note: for more information, see https://github.com/rust-lang/rust/issues/60406 - = help: add `#![feature(param_attrs)]` to the crate attributes to enable - -error[E0658]: attributes on function parameters are unstable - --> $DIR/fn-arg-doc-comment.rs:8:5 - | -LL | /// Other - | ^^^^^^^^^ - | - = note: for more information, see https://github.com/rust-lang/rust/issues/60406 - = help: add `#![feature(param_attrs)]` to the crate attributes to enable - error[E0308]: mismatched types - --> $DIR/fn-arg-doc-comment.rs:22:7 + --> $DIR/fn-arg-doc-comment.rs:18:7 | LL | f("", ""); | ^^ expected u8, found reference @@ -44,7 +26,7 @@ LL | f("", ""); found type `&'static str` error[E0308]: mismatched types - --> $DIR/fn-arg-doc-comment.rs:22:11 + --> $DIR/fn-arg-doc-comment.rs:18:11 | LL | f("", ""); | ^^ expected u8, found reference @@ -53,7 +35,7 @@ LL | f("", ""); found type `&'static str` error[E0308]: mismatched types - --> $DIR/fn-arg-doc-comment.rs:29:9 + --> $DIR/fn-arg-doc-comment.rs:25:9 | LL | bar(""); | ^^ expected i32, found reference @@ -61,7 +43,6 @@ LL | bar(""); = note: expected type `i32` found type `&'static str` -error: aborting due to 8 previous errors +error: aborting due to 6 previous errors -Some errors have detailed explanations: E0308, E0658. -For more information about an error, try `rustc --explain E0308`. +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/rfc-2565-param-attrs/param-attrs-2018.rs b/src/test/ui/rfc-2565-param-attrs/param-attrs-2018.rs index e900ccab4fd83..acca7b2503d1b 100644 --- a/src/test/ui/rfc-2565-param-attrs/param-attrs-2018.rs +++ b/src/test/ui/rfc-2565-param-attrs/param-attrs-2018.rs @@ -1,7 +1,5 @@ // edition:2018 -#![feature(param_attrs)] - trait Trait2015 { fn foo(#[allow(C)] i32); } //~^ ERROR expected one of `:` or `@`, found `)` diff --git a/src/test/ui/rfc-2565-param-attrs/param-attrs-2018.stderr b/src/test/ui/rfc-2565-param-attrs/param-attrs-2018.stderr index d0ed65f288011..f650199794163 100644 --- a/src/test/ui/rfc-2565-param-attrs/param-attrs-2018.stderr +++ b/src/test/ui/rfc-2565-param-attrs/param-attrs-2018.stderr @@ -1,5 +1,5 @@ error: expected one of `:` or `@`, found `)` - --> $DIR/param-attrs-2018.rs:5:41 + --> $DIR/param-attrs-2018.rs:3:41 | LL | trait Trait2015 { fn foo(#[allow(C)] i32); } | ^ expected one of `:` or `@` here diff --git a/src/test/ui/rfc-2565-param-attrs/param-attrs-allowed.rs b/src/test/ui/rfc-2565-param-attrs/param-attrs-allowed.rs index 5eeda66173ded..1217f89cb3168 100644 --- a/src/test/ui/rfc-2565-param-attrs/param-attrs-allowed.rs +++ b/src/test/ui/rfc-2565-param-attrs/param-attrs-allowed.rs @@ -2,7 +2,6 @@ // compile-flags: --cfg something #![deny(unused_mut)] -#![feature(param_attrs)] extern "C" { fn ffi( diff --git a/src/test/ui/rfc-2565-param-attrs/param-attrs-builtin-attrs.rs b/src/test/ui/rfc-2565-param-attrs/param-attrs-builtin-attrs.rs index b957c673a41f1..ef6cf75640be3 100644 --- a/src/test/ui/rfc-2565-param-attrs/param-attrs-builtin-attrs.rs +++ b/src/test/ui/rfc-2565-param-attrs/param-attrs-builtin-attrs.rs @@ -1,5 +1,3 @@ -#![feature(param_attrs)] - extern "C" { fn ffi( /// Foo diff --git a/src/test/ui/rfc-2565-param-attrs/param-attrs-builtin-attrs.stderr b/src/test/ui/rfc-2565-param-attrs/param-attrs-builtin-attrs.stderr index a57572abb3513..86123175c8856 100644 --- a/src/test/ui/rfc-2565-param-attrs/param-attrs-builtin-attrs.stderr +++ b/src/test/ui/rfc-2565-param-attrs/param-attrs-builtin-attrs.stderr @@ -1,269 +1,269 @@ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:5:9 + --> $DIR/param-attrs-builtin-attrs.rs:3:9 | LL | /// Foo | ^^^^^^^ doc comments are not allowed here error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:9:9 + --> $DIR/param-attrs-builtin-attrs.rs:7:9 | LL | /// Bar | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:11:9 + --> $DIR/param-attrs-builtin-attrs.rs:9:9 | LL | #[must_use] | ^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:13:9 + --> $DIR/param-attrs-builtin-attrs.rs:11:9 | LL | /// Baz | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:15:9 + --> $DIR/param-attrs-builtin-attrs.rs:13:9 | LL | #[no_mangle] b: i32, | ^^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:21:5 + --> $DIR/param-attrs-builtin-attrs.rs:19:5 | LL | /// Foo | ^^^^^^^ doc comments are not allowed here error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:25:5 + --> $DIR/param-attrs-builtin-attrs.rs:23:5 | LL | /// Bar | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:27:5 + --> $DIR/param-attrs-builtin-attrs.rs:25:5 | LL | #[must_use] | ^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:29:5 + --> $DIR/param-attrs-builtin-attrs.rs:27:5 | LL | /// Baz | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:31:5 + --> $DIR/param-attrs-builtin-attrs.rs:29:5 | LL | #[no_mangle] b: i32, | ^^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:36:5 + --> $DIR/param-attrs-builtin-attrs.rs:34:5 | LL | /// Foo | ^^^^^^^ doc comments are not allowed here error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:40:5 + --> $DIR/param-attrs-builtin-attrs.rs:38:5 | LL | /// Bar | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:42:5 + --> $DIR/param-attrs-builtin-attrs.rs:40:5 | LL | #[must_use] | ^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:44:5 + --> $DIR/param-attrs-builtin-attrs.rs:42:5 | LL | /// Baz | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:46:5 + --> $DIR/param-attrs-builtin-attrs.rs:44:5 | LL | #[no_mangle] b: i32, | ^^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:53:9 + --> $DIR/param-attrs-builtin-attrs.rs:51:9 | LL | /// Foo | ^^^^^^^ doc comments are not allowed here error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:56:9 + --> $DIR/param-attrs-builtin-attrs.rs:54:9 | LL | /// Bar | ^^^^^^^ doc comments are not allowed here error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:60:9 + --> $DIR/param-attrs-builtin-attrs.rs:58:9 | LL | /// Baz | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:62:9 + --> $DIR/param-attrs-builtin-attrs.rs:60:9 | LL | #[must_use] | ^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:64:9 + --> $DIR/param-attrs-builtin-attrs.rs:62:9 | LL | /// Qux | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:66:9 + --> $DIR/param-attrs-builtin-attrs.rs:64:9 | LL | #[no_mangle] b: i32, | ^^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:74:9 + --> $DIR/param-attrs-builtin-attrs.rs:72:9 | LL | /// Foo | ^^^^^^^ doc comments are not allowed here error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:77:9 + --> $DIR/param-attrs-builtin-attrs.rs:75:9 | LL | /// Bar | ^^^^^^^ doc comments are not allowed here error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:81:9 + --> $DIR/param-attrs-builtin-attrs.rs:79:9 | LL | /// Baz | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:83:9 + --> $DIR/param-attrs-builtin-attrs.rs:81:9 | LL | #[must_use] | ^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:85:9 + --> $DIR/param-attrs-builtin-attrs.rs:83:9 | LL | /// Qux | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:87:9 + --> $DIR/param-attrs-builtin-attrs.rs:85:9 | LL | #[no_mangle] b: i32, | ^^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:93:9 + --> $DIR/param-attrs-builtin-attrs.rs:91:9 | LL | /// Foo | ^^^^^^^ doc comments are not allowed here error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:96:9 + --> $DIR/param-attrs-builtin-attrs.rs:94:9 | LL | /// Bar | ^^^^^^^ doc comments are not allowed here error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:100:9 + --> $DIR/param-attrs-builtin-attrs.rs:98:9 | LL | /// Baz | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:102:9 + --> $DIR/param-attrs-builtin-attrs.rs:100:9 | LL | #[must_use] | ^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:104:9 + --> $DIR/param-attrs-builtin-attrs.rs:102:9 | LL | /// Qux | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:106:9 + --> $DIR/param-attrs-builtin-attrs.rs:104:9 | LL | #[no_mangle] b: i32, | ^^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:112:9 + --> $DIR/param-attrs-builtin-attrs.rs:110:9 | LL | /// Foo | ^^^^^^^ doc comments are not allowed here error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:115:9 + --> $DIR/param-attrs-builtin-attrs.rs:113:9 | LL | /// Bar | ^^^^^^^ doc comments are not allowed here error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:119:9 + --> $DIR/param-attrs-builtin-attrs.rs:117:9 | LL | /// Baz | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:121:9 + --> $DIR/param-attrs-builtin-attrs.rs:119:9 | LL | #[must_use] | ^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:123:9 + --> $DIR/param-attrs-builtin-attrs.rs:121:9 | LL | /// Qux | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:125:9 + --> $DIR/param-attrs-builtin-attrs.rs:123:9 | LL | #[no_mangle] b: i32, | ^^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:132:9 + --> $DIR/param-attrs-builtin-attrs.rs:130:9 | LL | /// Foo | ^^^^^^^ doc comments are not allowed here error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:136:9 + --> $DIR/param-attrs-builtin-attrs.rs:134:9 | LL | /// Bar | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:138:9 + --> $DIR/param-attrs-builtin-attrs.rs:136:9 | LL | #[must_use] | ^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:140:9 + --> $DIR/param-attrs-builtin-attrs.rs:138:9 | LL | /// Baz | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:142:9 + --> $DIR/param-attrs-builtin-attrs.rs:140:9 | LL | #[no_mangle] b: i32 | ^^^^^^^^^^^^ error[E0658]: the attribute `test` is currently unknown to the compiler and may have meaning added to it in the future - --> $DIR/param-attrs-builtin-attrs.rs:7:9 + --> $DIR/param-attrs-builtin-attrs.rs:5:9 | LL | #[test] a: i32, | ^^^^^^^ @@ -272,7 +272,7 @@ LL | #[test] a: i32, = help: add `#![feature(custom_attribute)]` to the crate attributes to enable error[E0658]: the attribute `test` is currently unknown to the compiler and may have meaning added to it in the future - --> $DIR/param-attrs-builtin-attrs.rs:23:5 + --> $DIR/param-attrs-builtin-attrs.rs:21:5 | LL | #[test] a: u32, | ^^^^^^^ @@ -281,7 +281,7 @@ LL | #[test] a: u32, = help: add `#![feature(custom_attribute)]` to the crate attributes to enable error[E0658]: the attribute `test` is currently unknown to the compiler and may have meaning added to it in the future - --> $DIR/param-attrs-builtin-attrs.rs:38:5 + --> $DIR/param-attrs-builtin-attrs.rs:36:5 | LL | #[test] a: u32, | ^^^^^^^ @@ -290,7 +290,7 @@ LL | #[test] a: u32, = help: add `#![feature(custom_attribute)]` to the crate attributes to enable error[E0658]: the attribute `test` is currently unknown to the compiler and may have meaning added to it in the future - --> $DIR/param-attrs-builtin-attrs.rs:58:9 + --> $DIR/param-attrs-builtin-attrs.rs:56:9 | LL | #[test] a: i32, | ^^^^^^^ @@ -299,7 +299,7 @@ LL | #[test] a: i32, = help: add `#![feature(custom_attribute)]` to the crate attributes to enable error[E0658]: the attribute `test` is currently unknown to the compiler and may have meaning added to it in the future - --> $DIR/param-attrs-builtin-attrs.rs:79:9 + --> $DIR/param-attrs-builtin-attrs.rs:77:9 | LL | #[test] a: i32, | ^^^^^^^ @@ -308,7 +308,7 @@ LL | #[test] a: i32, = help: add `#![feature(custom_attribute)]` to the crate attributes to enable error[E0658]: the attribute `test` is currently unknown to the compiler and may have meaning added to it in the future - --> $DIR/param-attrs-builtin-attrs.rs:98:9 + --> $DIR/param-attrs-builtin-attrs.rs:96:9 | LL | #[test] a: i32, | ^^^^^^^ @@ -317,7 +317,7 @@ LL | #[test] a: i32, = help: add `#![feature(custom_attribute)]` to the crate attributes to enable error[E0658]: the attribute `test` is currently unknown to the compiler and may have meaning added to it in the future - --> $DIR/param-attrs-builtin-attrs.rs:117:9 + --> $DIR/param-attrs-builtin-attrs.rs:115:9 | LL | #[test] a: i32, | ^^^^^^^ @@ -326,7 +326,7 @@ LL | #[test] a: i32, = help: add `#![feature(custom_attribute)]` to the crate attributes to enable error[E0658]: the attribute `test` is currently unknown to the compiler and may have meaning added to it in the future - --> $DIR/param-attrs-builtin-attrs.rs:134:9 + --> $DIR/param-attrs-builtin-attrs.rs:132:9 | LL | #[test] a: u32, | ^^^^^^^ diff --git a/src/test/ui/rfc-2565-param-attrs/param-attrs-cfg.rs b/src/test/ui/rfc-2565-param-attrs/param-attrs-cfg.rs index 5ad6e23cf2a63..d44ff14e99247 100644 --- a/src/test/ui/rfc-2565-param-attrs/param-attrs-cfg.rs +++ b/src/test/ui/rfc-2565-param-attrs/param-attrs-cfg.rs @@ -1,7 +1,7 @@ // compile-flags: --cfg something // edition:2018 -#![feature(async_closure, param_attrs)] +#![feature(async_closure)] #![deny(unused_variables)] extern "C" { diff --git a/src/test/ui/rfc-2565-param-attrs/param-attrs-feature-gate.rs b/src/test/ui/rfc-2565-param-attrs/param-attrs-feature-gate.rs index a7f4855915b24..9b9f9f7ef9431 100644 --- a/src/test/ui/rfc-2565-param-attrs/param-attrs-feature-gate.rs +++ b/src/test/ui/rfc-2565-param-attrs/param-attrs-feature-gate.rs @@ -6,11 +6,7 @@ fn foo( /// Foo //~^ ERROR documentation comments cannot be applied to function parameters //~| NOTE doc comments are not allowed here - //~| ERROR attributes on function parameters are unstable - //~| NOTE https://github.com/rust-lang/rust/issues/60406 #[allow(unused_variables)] a: u8 - //~^ ERROR attributes on function parameters are unstable - //~| NOTE https://github.com/rust-lang/rust/issues/60406 ) {} fn main() {} diff --git a/src/test/ui/rfc-2565-param-attrs/param-attrs-feature-gate.stderr b/src/test/ui/rfc-2565-param-attrs/param-attrs-feature-gate.stderr index 0bb9d05dca0ac..7ad4f2a196ba8 100644 --- a/src/test/ui/rfc-2565-param-attrs/param-attrs-feature-gate.stderr +++ b/src/test/ui/rfc-2565-param-attrs/param-attrs-feature-gate.stderr @@ -4,24 +4,5 @@ error: documentation comments cannot be applied to function parameters LL | /// Foo | ^^^^^^^ doc comments are not allowed here -error[E0658]: attributes on function parameters are unstable - --> $DIR/param-attrs-feature-gate.rs:6:5 - | -LL | /// Foo - | ^^^^^^^ - | - = note: for more information, see https://github.com/rust-lang/rust/issues/60406 - = help: add `#![feature(param_attrs)]` to the crate attributes to enable - -error[E0658]: attributes on function parameters are unstable - --> $DIR/param-attrs-feature-gate.rs:11:5 - | -LL | #[allow(unused_variables)] a: u8 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: for more information, see https://github.com/rust-lang/rust/issues/60406 - = help: add `#![feature(param_attrs)]` to the crate attributes to enable - -error: aborting due to 3 previous errors +error: aborting due to previous error -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/rfc-2565-param-attrs/param-attrs-pretty.rs b/src/test/ui/rfc-2565-param-attrs/param-attrs-pretty.rs index 1a7e948174506..fb86020d992e9 100644 --- a/src/test/ui/rfc-2565-param-attrs/param-attrs-pretty.rs +++ b/src/test/ui/rfc-2565-param-attrs/param-attrs-pretty.rs @@ -2,7 +2,6 @@ // check-pass -#![feature(param_attrs)] #![feature(c_variadic)] extern crate param_attrs;