From f7256d28d1c2f8340ab5b99df4bdb15aa232f3f3 Mon Sep 17 00:00:00 2001 From: Ross MacArthur Date: Sat, 21 Dec 2019 13:16:18 +0200 Subject: Require issue = "none" over issue = "0" in unstable attributes --- .../allow-warnings-cmdline-stability/bar.rs | 2 +- src/test/rustdoc/const-display.rs | 8 ++-- src/test/rustdoc/inline_cross/auxiliary/macros.rs | 2 +- src/test/rustdoc/stability.rs | 2 +- src/test/ui/auxiliary/stability-cfg2.rs | 2 +- .../ui/consts/const-eval/auxiliary/stability.rs | 2 +- .../const-eval/dont_promote_unstable_const_fn.rs | 4 +- .../min_const_fn/min_const_fn_libstd_stability.rs | 8 ++-- .../min_const_unsafe_fn_libstd_stability.rs | 8 ++-- .../min_const_unsafe_fn_libstd_stability2.rs | 8 ++-- src/test/ui/consts/unstable-const-fn-in-libcore.rs | 2 +- .../stability-attribute-consistency.rs | 2 +- .../stability-attribute-consistency.stderr | 4 +- .../unstable-attribute-allow-issue-0.rs | 13 ++++++ .../unstable-attribute-allow-issue-0.stderr | 8 ++++ .../unstable-attribute-allow-issue-none.rs | 13 ------ .../unstable-attribute-allow-issue-none.stderr | 8 ---- .../ui/internal/auxiliary/internal_unstable.rs | 8 ++-- src/test/ui/issues/auxiliary/issue-52489.rs | 2 +- src/test/ui/issues/auxiliary/lint-stability.rs | 46 +++++++++++----------- src/test/ui/issues/issue-17337.rs | 4 +- src/test/ui/lint/auxiliary/inherited_stability.rs | 8 ++-- src/test/ui/lint/auxiliary/lint_output_format.rs | 6 +-- src/test/ui/lint/auxiliary/lint_stability.rs | 46 +++++++++++----------- .../ui/lint/auxiliary/lint_stability_fields.rs | 24 +++++------ src/test/ui/lint/auxiliary/stability-cfg2.rs | 2 +- src/test/ui/lint/auxiliary/stability_cfg2.rs | 2 +- src/test/ui/lint/lint-stability-2.rs | 46 +++++++++++----------- src/test/ui/lint/lint-stability-deprecated.rs | 46 +++++++++++----------- .../ui/lint/lint-stability-fields-deprecated.rs | 22 +++++------ src/test/ui/lint/lint-stability-fields.rs | 22 +++++------ src/test/ui/lint/lint-stability.rs | 46 +++++++++++----------- src/test/ui/macros/auxiliary/unstable-macros.rs | 4 +- src/test/ui/macros/macro-stability-rpass.rs | 2 +- src/test/ui/macros/macro-stability.rs | 4 +- src/test/ui/missing/missing-stability.rs | 2 +- .../stability-attribute-sanity.rs | 12 +++--- .../stability-attribute-sanity.stderr | 12 +++--- 38 files changed, 231 insertions(+), 231 deletions(-) create mode 100644 src/test/ui/feature-gate/unstable-attribute-allow-issue-0.rs create mode 100644 src/test/ui/feature-gate/unstable-attribute-allow-issue-0.stderr delete mode 100644 src/test/ui/feature-gate/unstable-attribute-allow-issue-none.rs delete mode 100644 src/test/ui/feature-gate/unstable-attribute-allow-issue-none.stderr (limited to 'src/test') diff --git a/src/test/run-make-fulldeps/allow-warnings-cmdline-stability/bar.rs b/src/test/run-make-fulldeps/allow-warnings-cmdline-stability/bar.rs index 2a977ed63b1..3dcfb9dadd8 100644 --- a/src/test/run-make-fulldeps/allow-warnings-cmdline-stability/bar.rs +++ b/src/test/run-make-fulldeps/allow-warnings-cmdline-stability/bar.rs @@ -1,5 +1,5 @@ #![crate_type = "lib"] #![feature(staged_api)] -#![unstable(feature = "unstable_test_feature", issue = "0")] +#![unstable(feature = "unstable_test_feature", issue = "none")] pub fn baz() {} diff --git a/src/test/rustdoc/const-display.rs b/src/test/rustdoc/const-display.rs index bc7ad04b6a2..8e0d230f7d0 100644 --- a/src/test/rustdoc/const-display.rs +++ b/src/test/rustdoc/const-display.rs @@ -2,18 +2,18 @@ #![unstable(feature = "humans", reason = "who ever let humans program computers, we're apparently really bad at it", - issue = "0")] + issue = "none")] #![feature(foo, foo2)] #![feature(staged_api)] // @has 'foo/fn.foo.html' '//pre' 'pub unsafe fn foo() -> u32' #[stable(feature = "rust1", since = "1.0.0")] -#[rustc_const_unstable(feature="foo", issue = "0")] +#[rustc_const_unstable(feature="foo", issue = "none")] pub const unsafe fn foo() -> u32 { 42 } // @has 'foo/fn.foo2.html' '//pre' 'pub fn foo2() -> u32' -#[unstable(feature = "humans", issue="0")] +#[unstable(feature = "humans", issue = "none")] pub const fn foo2() -> u32 { 42 } // @has 'foo/fn.bar2.html' '//pre' 'pub const fn bar2() -> u32' @@ -22,7 +22,7 @@ pub const fn foo2() -> u32 { 42 } pub const fn bar2() -> u32 { 42 } // @has 'foo/fn.foo2_gated.html' '//pre' 'pub unsafe fn foo2_gated() -> u32' -#[unstable(feature = "foo2", issue="0")] +#[unstable(feature = "foo2", issue = "none")] pub const unsafe fn foo2_gated() -> u32 { 42 } // @has 'foo/fn.bar2_gated.html' '//pre' 'pub const unsafe fn bar2_gated() -> u32' diff --git a/src/test/rustdoc/inline_cross/auxiliary/macros.rs b/src/test/rustdoc/inline_cross/auxiliary/macros.rs index 6189b018037..2165be97452 100644 --- a/src/test/rustdoc/inline_cross/auxiliary/macros.rs +++ b/src/test/rustdoc/inline_cross/auxiliary/macros.rs @@ -3,7 +3,7 @@ #![stable(feature = "rust1", since = "1.0.0")] /// docs for my_macro -#[unstable(feature = "macro_test", issue = "0")] +#[unstable(feature = "macro_test", issue = "none")] #[rustc_deprecated(since = "1.2.3", reason = "text")] #[macro_export] macro_rules! my_macro { diff --git a/src/test/rustdoc/stability.rs b/src/test/rustdoc/stability.rs index 18a21603493..b1b97fe134e 100644 --- a/src/test/rustdoc/stability.rs +++ b/src/test/rustdoc/stability.rs @@ -1,6 +1,6 @@ #![feature(staged_api)] -#![unstable(feature = "test", issue = "0")] +#![unstable(feature = "test", issue = "none")] pub struct Unstable { // @has stability/struct.Unstable.html \ diff --git a/src/test/ui/auxiliary/stability-cfg2.rs b/src/test/ui/auxiliary/stability-cfg2.rs index 8a2899584b9..c995038e5a8 100644 --- a/src/test/ui/auxiliary/stability-cfg2.rs +++ b/src/test/ui/auxiliary/stability-cfg2.rs @@ -1,5 +1,5 @@ // compile-flags:--cfg foo -#![cfg_attr(foo, unstable(feature = "unstable_test_feature", issue = "0"))] +#![cfg_attr(foo, unstable(feature = "unstable_test_feature", issue = "none"))] #![cfg_attr(not(foo), stable(feature = "test_feature", since = "1.0.0"))] #![feature(staged_api)] diff --git a/src/test/ui/consts/const-eval/auxiliary/stability.rs b/src/test/ui/consts/const-eval/auxiliary/stability.rs index 830db55207f..70531114f21 100644 --- a/src/test/ui/consts/const-eval/auxiliary/stability.rs +++ b/src/test/ui/consts/const-eval/auxiliary/stability.rs @@ -7,5 +7,5 @@ #![feature(staged_api)] #[stable(feature = "rust1", since = "1.0.0")] -#[rustc_const_unstable(feature="foo", issue = "0")] +#[rustc_const_unstable(feature="foo", issue = "none")] pub const fn foo() -> u32 { 42 } diff --git a/src/test/ui/consts/const-eval/dont_promote_unstable_const_fn.rs b/src/test/ui/consts/const-eval/dont_promote_unstable_const_fn.rs index c4b89b50bc4..3729285956b 100644 --- a/src/test/ui/consts/const-eval/dont_promote_unstable_const_fn.rs +++ b/src/test/ui/consts/const-eval/dont_promote_unstable_const_fn.rs @@ -1,13 +1,13 @@ #![unstable(feature = "humans", reason = "who ever let humans program computers, we're apparently really bad at it", - issue = "0")] + issue = "none")] #![feature(const_fn)] #![feature(staged_api)] #[stable(feature = "rust1", since = "1.0.0")] -#[rustc_const_unstable(feature="foo", issue = "0")] +#[rustc_const_unstable(feature="foo", issue = "none")] const fn foo() -> u32 { 42 } fn meh() -> u32 { 42 } diff --git a/src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.rs b/src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.rs index 97e467aece2..df10f3496c3 100644 --- a/src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.rs +++ b/src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.rs @@ -1,13 +1,13 @@ #![unstable(feature = "humans", reason = "who ever let humans program computers, we're apparently really bad at it", - issue = "0")] + issue = "none")] #![feature(const_fn, foo, foo2)] #![feature(staged_api)] #[stable(feature = "rust1", since = "1.0.0")] -#[rustc_const_unstable(feature="foo", issue = "0")] +#[rustc_const_unstable(feature="foo", issue = "none")] const fn foo() -> u32 { 42 } #[stable(feature = "rust1", since = "1.0.0")] @@ -15,7 +15,7 @@ const fn foo() -> u32 { 42 } // can't call non-min_const_fn const fn bar() -> u32 { foo() } //~ ERROR can only call other `const fn` -#[unstable(feature = "rust1", issue="0")] +#[unstable(feature = "rust1", issue = "none")] const fn foo2() -> u32 { 42 } #[stable(feature = "rust1", since = "1.0.0")] @@ -29,7 +29,7 @@ const fn bar2() -> u32 { foo2() } //~ ERROR can only call other `const fn` const fn bar3() -> u32 { (5f32 + 6f32) as u32 } //~ ERROR only int, `bool` and `char` operations // check whether this function cannot be called even with the feature gate active -#[unstable(feature = "foo2", issue="0")] +#[unstable(feature = "foo2", issue = "none")] const fn foo2_gated() -> u32 { 42 } #[stable(feature = "rust1", since = "1.0.0")] diff --git a/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.rs b/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.rs index 102b3801441..12b41ee2b0d 100644 --- a/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.rs +++ b/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.rs @@ -1,13 +1,13 @@ #![unstable(feature = "humans", reason = "who ever let humans program computers, we're apparently really bad at it", - issue = "0")] + issue = "none")] #![feature(const_fn, foo, foo2)] #![feature(staged_api)] #[stable(feature = "rust1", since = "1.0.0")] -#[rustc_const_unstable(feature="foo", issue = "0")] +#[rustc_const_unstable(feature="foo", issue = "none")] const unsafe fn foo() -> u32 { 42 } #[stable(feature = "rust1", since = "1.0.0")] @@ -15,7 +15,7 @@ const unsafe fn foo() -> u32 { 42 } // can't call non-min_const_fn const unsafe fn bar() -> u32 { unsafe { foo() } } //~ ERROR can only call other `const fn` -#[unstable(feature = "rust1", issue="0")] +#[unstable(feature = "rust1", issue = "none")] const unsafe fn foo2() -> u32 { 42 } #[stable(feature = "rust1", since = "1.0.0")] @@ -29,7 +29,7 @@ const unsafe fn bar2() -> u32 { unsafe { foo2() } } //~ ERROR can only call othe const unsafe fn bar3() -> u32 { (5f32 + 6f32) as u32 } //~ ERROR only int, `bool` and `char` op // check whether this function cannot be called even with the feature gate active -#[unstable(feature = "foo2", issue="0")] +#[unstable(feature = "foo2", issue = "none")] const unsafe fn foo2_gated() -> u32 { 42 } #[stable(feature = "rust1", since = "1.0.0")] diff --git a/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.rs b/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.rs index 121177f8366..44a62094987 100644 --- a/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.rs +++ b/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.rs @@ -1,13 +1,13 @@ #![unstable(feature = "humans", reason = "who ever let humans program computers, we're apparently really bad at it", - issue = "0")] + issue = "none")] #![feature(const_fn, foo, foo2)] #![feature(staged_api)] #[stable(feature = "rust1", since = "1.0.0")] -#[rustc_const_unstable(feature="foo", issue = "0")] +#[rustc_const_unstable(feature="foo", issue = "none")] const fn foo() -> u32 { 42 } #[stable(feature = "rust1", since = "1.0.0")] @@ -15,7 +15,7 @@ const fn foo() -> u32 { 42 } // can't call non-min_const_fn const unsafe fn bar() -> u32 { foo() } //~ ERROR can only call other `const fn` -#[unstable(feature = "rust1", issue="0")] +#[unstable(feature = "rust1", issue = "none")] const fn foo2() -> u32 { 42 } #[stable(feature = "rust1", since = "1.0.0")] @@ -24,7 +24,7 @@ const fn foo2() -> u32 { 42 } const unsafe fn bar2() -> u32 { foo2() } //~ ERROR can only call other `const fn` // check whether this function cannot be called even with the feature gate active -#[unstable(feature = "foo2", issue="0")] +#[unstable(feature = "foo2", issue = "none")] const fn foo2_gated() -> u32 { 42 } #[stable(feature = "rust1", since = "1.0.0")] diff --git a/src/test/ui/consts/unstable-const-fn-in-libcore.rs b/src/test/ui/consts/unstable-const-fn-in-libcore.rs index 655ad7b548a..0b64786ccce 100644 --- a/src/test/ui/consts/unstable-const-fn-in-libcore.rs +++ b/src/test/ui/consts/unstable-const-fn-in-libcore.rs @@ -14,7 +14,7 @@ enum Opt { } impl Opt { - #[rustc_const_unstable(feature = "foo", issue = "0")] + #[rustc_const_unstable(feature = "foo", issue = "none")] #[stable(feature = "rust1", since = "1.0.0")] const fn unwrap_or_else T>(self, f: F) -> T { //~^ ERROR destructors cannot be evaluated at compile-time diff --git a/src/test/ui/feature-gate/stability-attribute-consistency.rs b/src/test/ui/feature-gate/stability-attribute-consistency.rs index caafd8b8854..6ee7003c31e 100644 --- a/src/test/ui/feature-gate/stability-attribute-consistency.rs +++ b/src/test/ui/feature-gate/stability-attribute-consistency.rs @@ -9,7 +9,7 @@ fn foo_stable_1_0_0() {} //~^ ERROR feature `foo` is declared stable since 1.29.0 fn foo_stable_1_29_0() {} -#[unstable(feature = "foo", issue = "0")] +#[unstable(feature = "foo", issue = "none")] //~^ ERROR feature `foo` is declared unstable fn foo_unstable() {} diff --git a/src/test/ui/feature-gate/stability-attribute-consistency.stderr b/src/test/ui/feature-gate/stability-attribute-consistency.stderr index 9b4b28a3922..d49b44c8a35 100644 --- a/src/test/ui/feature-gate/stability-attribute-consistency.stderr +++ b/src/test/ui/feature-gate/stability-attribute-consistency.stderr @@ -7,8 +7,8 @@ LL | #[stable(feature = "foo", since = "1.29.0")] error[E0711]: feature `foo` is declared unstable, but was previously declared stable --> $DIR/stability-attribute-consistency.rs:12:1 | -LL | #[unstable(feature = "foo", issue = "0")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[unstable(feature = "foo", issue = "none")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/feature-gate/unstable-attribute-allow-issue-0.rs b/src/test/ui/feature-gate/unstable-attribute-allow-issue-0.rs new file mode 100644 index 00000000000..c8ad0d13a14 --- /dev/null +++ b/src/test/ui/feature-gate/unstable-attribute-allow-issue-0.rs @@ -0,0 +1,13 @@ +// Check that an issue value can be explicitly set to "0" instead of "none" +#![crate_type = "lib"] +#![feature(staged_api)] +#![stable(feature = "stable_test_feature", since = "1.0.0")] + +#[unstable(feature = "unstable_test_feature", issue = "0")] +fn unstable_issue_0() {} + +#[unstable(feature = "unstable_test_feature", issue = "none")] +fn unstable_issue_none() {} + +#[unstable(feature = "unstable_test_feature", issue = "something")] //~ ERROR incorrect 'issue' +fn unstable_issue_not_allowed() {} diff --git a/src/test/ui/feature-gate/unstable-attribute-allow-issue-0.stderr b/src/test/ui/feature-gate/unstable-attribute-allow-issue-0.stderr new file mode 100644 index 00000000000..10bd6f373d9 --- /dev/null +++ b/src/test/ui/feature-gate/unstable-attribute-allow-issue-0.stderr @@ -0,0 +1,8 @@ +error[E0545]: incorrect 'issue' + --> $DIR/unstable-attribute-allow-issue-0.rs:12:1 + | +LL | #[unstable(feature = "unstable_test_feature", issue = "something")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/feature-gate/unstable-attribute-allow-issue-none.rs b/src/test/ui/feature-gate/unstable-attribute-allow-issue-none.rs deleted file mode 100644 index 3ce9de3fb1b..00000000000 --- a/src/test/ui/feature-gate/unstable-attribute-allow-issue-none.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Check that an issue value can be explicitly set to "none" instead of "0" -#![crate_type = "lib"] -#![feature(staged_api)] -#![stable(feature = "stable_test_feature", since = "1.0.0")] - -#[unstable(feature = "unstable_test_feature", issue = "0")] -fn unstable_issue_0() {} - -#[unstable(feature = "unstable_test_feature", issue = "none")] -fn unstable_issue_none() {} - -#[unstable(feature = "unstable_test_feature", issue = "something")] //~ ERROR incorrect 'issue' -fn unstable_issue_not_allowed() {} diff --git a/src/test/ui/feature-gate/unstable-attribute-allow-issue-none.stderr b/src/test/ui/feature-gate/unstable-attribute-allow-issue-none.stderr deleted file mode 100644 index fc031f5f8c5..00000000000 --- a/src/test/ui/feature-gate/unstable-attribute-allow-issue-none.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error[E0545]: incorrect 'issue' - --> $DIR/unstable-attribute-allow-issue-none.rs:12:1 - | -LL | #[unstable(feature = "unstable_test_feature", issue = "something")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/internal/auxiliary/internal_unstable.rs b/src/test/ui/internal/auxiliary/internal_unstable.rs index 7c79dcb7522..148cbd1899e 100644 --- a/src/test/ui/internal/auxiliary/internal_unstable.rs +++ b/src/test/ui/internal/auxiliary/internal_unstable.rs @@ -1,24 +1,24 @@ #![feature(staged_api, allow_internal_unstable)] #![stable(feature = "stable", since = "1.0.0")] -#[unstable(feature = "function", issue = "0")] +#[unstable(feature = "function", issue = "none")] pub fn unstable() {} #[stable(feature = "stable", since = "1.0.0")] pub struct Foo { - #[unstable(feature = "struct_field", issue = "0")] + #[unstable(feature = "struct_field", issue = "none")] pub x: u8 } impl Foo { - #[unstable(feature = "method", issue = "0")] + #[unstable(feature = "method", issue = "none")] pub fn method(&self) {} } #[stable(feature = "stable", since = "1.0.0")] pub struct Bar { - #[unstable(feature = "struct2_field", issue = "0")] + #[unstable(feature = "struct2_field", issue = "none")] pub x: u8 } diff --git a/src/test/ui/issues/auxiliary/issue-52489.rs b/src/test/ui/issues/auxiliary/issue-52489.rs index c649930c2b4..f53bf7db525 100644 --- a/src/test/ui/issues/auxiliary/issue-52489.rs +++ b/src/test/ui/issues/auxiliary/issue-52489.rs @@ -1,3 +1,3 @@ #![crate_type = "lib"] -#![unstable(feature = "issue_52489_unstable", issue = "0")] +#![unstable(feature = "issue_52489_unstable", issue = "none")] #![feature(staged_api)] diff --git a/src/test/ui/issues/auxiliary/lint-stability.rs b/src/test/ui/issues/auxiliary/lint-stability.rs index 3188d706ab0..de4058887cf 100644 --- a/src/test/ui/issues/auxiliary/lint-stability.rs +++ b/src/test/ui/issues/auxiliary/lint-stability.rs @@ -15,16 +15,16 @@ pub fn deprecated_text() {} #[rustc_deprecated(since = "99.99.99", reason = "text")] pub fn deprecated_future() {} -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn deprecated_unstable() {} -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn deprecated_unstable_text() {} -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] pub fn unstable() {} -#[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] +#[unstable(feature = "unstable_test_feature", reason = "text", issue = "none")] pub fn unstable_text() {} #[stable(feature = "rust1", since = "1.0.0")] @@ -43,16 +43,16 @@ impl MethodTester { #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn method_deprecated_text(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn method_deprecated_unstable(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn method_deprecated_unstable_text(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] pub fn method_unstable(&self) {} - #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] + #[unstable(feature = "unstable_test_feature", reason = "text", issue = "none")] pub fn method_unstable_text(&self) {} #[stable(feature = "rust1", since = "1.0.0")] @@ -70,16 +70,16 @@ pub trait Trait { #[rustc_deprecated(since = "1.0.0", reason = "text")] fn trait_deprecated_text(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn trait_deprecated_unstable(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn trait_deprecated_unstable_text(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] fn trait_unstable(&self) {} - #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] + #[unstable(feature = "unstable_test_feature", reason = "text", issue = "none")] fn trait_unstable_text(&self) {} #[stable(feature = "rust1", since = "1.0.0")] @@ -90,7 +90,7 @@ pub trait Trait { #[stable(feature = "stable_test_feature", since = "1.0.0")] pub trait TraitWithAssociatedTypes { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] type TypeUnstable = u8; #[stable(feature = "stable_test_feature", since = "1.0.0")] #[rustc_deprecated(since = "1.0.0", reason = "text")] @@ -100,7 +100,7 @@ pub trait TraitWithAssociatedTypes { #[stable(feature = "stable_test_feature", since = "1.0.0")] impl Trait for MethodTester {} -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] pub trait UnstableTrait { fn dummy(&self) { } } #[stable(feature = "stable_test_feature", since = "1.0.0")] @@ -114,12 +114,12 @@ pub trait DeprecatedTrait { pub struct DeprecatedStruct { #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize } -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedUnstableStruct { #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize } -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] pub struct UnstableStruct { #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize } @@ -127,7 +127,7 @@ pub struct UnstableStruct { pub struct StableStruct { #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize } -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] pub enum UnstableEnum {} #[stable(feature = "rust1", since = "1.0.0")] pub enum StableEnum {} @@ -135,10 +135,10 @@ pub enum StableEnum {} #[stable(feature = "stable_test_feature", since = "1.0.0")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedUnitStruct; -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedUnstableUnitStruct; -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] pub struct UnstableUnitStruct; #[stable(feature = "rust1", since = "1.0.0")] pub struct StableUnitStruct; @@ -148,10 +148,10 @@ pub enum Enum { #[stable(feature = "stable_test_feature", since = "1.0.0")] #[rustc_deprecated(since = "1.0.0", reason = "text")] DeprecatedVariant, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] DeprecatedUnstableVariant, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] UnstableVariant, #[stable(feature = "rust1", since = "1.0.0")] @@ -161,10 +161,10 @@ pub enum Enum { #[stable(feature = "stable_test_feature", since = "1.0.0")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize); -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedUnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize); -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] pub struct UnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize); #[stable(feature = "rust1", since = "1.0.0")] pub struct StableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize); diff --git a/src/test/ui/issues/issue-17337.rs b/src/test/ui/issues/issue-17337.rs index 1126ab7a206..65f2f8fc5ac 100644 --- a/src/test/ui/issues/issue-17337.rs +++ b/src/test/ui/issues/issue-17337.rs @@ -1,12 +1,12 @@ #![feature(staged_api)] #![deny(deprecated)] -#![unstable(feature = "unstable_test_feature", issue = "0")] +#![unstable(feature = "unstable_test_feature", issue = "none")] struct Foo; impl Foo { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn foo(self) {} } diff --git a/src/test/ui/lint/auxiliary/inherited_stability.rs b/src/test/ui/lint/auxiliary/inherited_stability.rs index 57af0d3ec9c..1e7eb26fde2 100644 --- a/src/test/ui/lint/auxiliary/inherited_stability.rs +++ b/src/test/ui/lint/auxiliary/inherited_stability.rs @@ -1,6 +1,6 @@ #![crate_name="inherited_stability"] #![crate_type = "lib"] -#![unstable(feature = "unstable_test_feature", issue = "0")] +#![unstable(feature = "unstable_test_feature", issue = "none")] #![feature(staged_api)] pub fn unstable() {} @@ -10,14 +10,14 @@ pub fn stable() {} #[stable(feature = "rust1", since = "1.0.0")] pub mod stable_mod { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] pub fn unstable() {} #[stable(feature = "rust1", since = "1.0.0")] pub fn stable() {} } -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] pub mod unstable_mod { #[stable(feature = "stable_test_feature", since = "1.0.0")] #[rustc_deprecated(since = "1.0.0", reason = "text")] @@ -28,7 +28,7 @@ pub mod unstable_mod { #[stable(feature = "rust1", since = "1.0.0")] pub trait Stable { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] fn unstable(&self); #[stable(feature = "rust1", since = "1.0.0")] diff --git a/src/test/ui/lint/auxiliary/lint_output_format.rs b/src/test/ui/lint/auxiliary/lint_output_format.rs index 5facb556122..58cae180196 100644 --- a/src/test/ui/lint/auxiliary/lint_output_format.rs +++ b/src/test/ui/lint/auxiliary/lint_output_format.rs @@ -1,7 +1,7 @@ #![crate_name="lint_output_format"] #![crate_type = "lib"] #![feature(staged_api)] -#![unstable(feature = "unstable_test_feature", issue = "0")] +#![unstable(feature = "unstable_test_feature", issue = "none")] #[stable(feature = "stable_test_feature", since = "1.0.0")] #[rustc_deprecated(since = "1.0.0", reason = "text")] @@ -9,12 +9,12 @@ pub fn foo() -> usize { 20 } -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] pub fn bar() -> usize { 40 } -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] pub fn baz() -> usize { 30 } diff --git a/src/test/ui/lint/auxiliary/lint_stability.rs b/src/test/ui/lint/auxiliary/lint_stability.rs index 3188d706ab0..de4058887cf 100644 --- a/src/test/ui/lint/auxiliary/lint_stability.rs +++ b/src/test/ui/lint/auxiliary/lint_stability.rs @@ -15,16 +15,16 @@ pub fn deprecated_text() {} #[rustc_deprecated(since = "99.99.99", reason = "text")] pub fn deprecated_future() {} -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn deprecated_unstable() {} -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn deprecated_unstable_text() {} -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] pub fn unstable() {} -#[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] +#[unstable(feature = "unstable_test_feature", reason = "text", issue = "none")] pub fn unstable_text() {} #[stable(feature = "rust1", since = "1.0.0")] @@ -43,16 +43,16 @@ impl MethodTester { #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn method_deprecated_text(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn method_deprecated_unstable(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn method_deprecated_unstable_text(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] pub fn method_unstable(&self) {} - #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] + #[unstable(feature = "unstable_test_feature", reason = "text", issue = "none")] pub fn method_unstable_text(&self) {} #[stable(feature = "rust1", since = "1.0.0")] @@ -70,16 +70,16 @@ pub trait Trait { #[rustc_deprecated(since = "1.0.0", reason = "text")] fn trait_deprecated_text(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn trait_deprecated_unstable(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn trait_deprecated_unstable_text(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] fn trait_unstable(&self) {} - #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] + #[unstable(feature = "unstable_test_feature", reason = "text", issue = "none")] fn trait_unstable_text(&self) {} #[stable(feature = "rust1", since = "1.0.0")] @@ -90,7 +90,7 @@ pub trait Trait { #[stable(feature = "stable_test_feature", since = "1.0.0")] pub trait TraitWithAssociatedTypes { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] type TypeUnstable = u8; #[stable(feature = "stable_test_feature", since = "1.0.0")] #[rustc_deprecated(since = "1.0.0", reason = "text")] @@ -100,7 +100,7 @@ pub trait TraitWithAssociatedTypes { #[stable(feature = "stable_test_feature", since = "1.0.0")] impl Trait for MethodTester {} -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] pub trait UnstableTrait { fn dummy(&self) { } } #[stable(feature = "stable_test_feature", since = "1.0.0")] @@ -114,12 +114,12 @@ pub trait DeprecatedTrait { pub struct DeprecatedStruct { #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize } -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedUnstableStruct { #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize } -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] pub struct UnstableStruct { #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize } @@ -127,7 +127,7 @@ pub struct UnstableStruct { pub struct StableStruct { #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize } -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] pub enum UnstableEnum {} #[stable(feature = "rust1", since = "1.0.0")] pub enum StableEnum {} @@ -135,10 +135,10 @@ pub enum StableEnum {} #[stable(feature = "stable_test_feature", since = "1.0.0")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedUnitStruct; -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedUnstableUnitStruct; -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] pub struct UnstableUnitStruct; #[stable(feature = "rust1", since = "1.0.0")] pub struct StableUnitStruct; @@ -148,10 +148,10 @@ pub enum Enum { #[stable(feature = "stable_test_feature", since = "1.0.0")] #[rustc_deprecated(since = "1.0.0", reason = "text")] DeprecatedVariant, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] DeprecatedUnstableVariant, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] UnstableVariant, #[stable(feature = "rust1", since = "1.0.0")] @@ -161,10 +161,10 @@ pub enum Enum { #[stable(feature = "stable_test_feature", since = "1.0.0")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize); -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedUnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize); -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] pub struct UnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize); #[stable(feature = "rust1", since = "1.0.0")] pub struct StableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize); diff --git a/src/test/ui/lint/auxiliary/lint_stability_fields.rs b/src/test/ui/lint/auxiliary/lint_stability_fields.rs index 2787da7cb71..0efe7686ef7 100644 --- a/src/test/ui/lint/auxiliary/lint_stability_fields.rs +++ b/src/test/ui/lint/auxiliary/lint_stability_fields.rs @@ -5,47 +5,47 @@ pub struct Stable { #[stable(feature = "rust1", since = "1.0.0")] pub inherit: u8, // it's a lie (stable doesn't inherit) - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] pub override1: u8, #[rustc_deprecated(since = "1.0.0", reason = "text")] - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] pub override2: u8, } #[stable(feature = "rust1", since = "1.0.0")] pub struct Stable2(#[stable(feature = "rust1", since = "1.0.0")] pub u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] pub u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] pub u8, + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub u8); -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] pub struct Unstable { pub inherit: u8, #[stable(feature = "rust1", since = "1.0.0")] pub override1: u8, #[rustc_deprecated(since = "1.0.0", reason = "text")] - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] pub override2: u8, } -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] pub struct Unstable2(pub u8, #[stable(feature = "rust1", since = "1.0.0")] pub u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub u8); -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct Deprecated { pub inherit: u8, #[stable(feature = "rust1", since = "1.0.0")] pub override1: u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] pub override2: u8, } -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct Deprecated2(pub u8, #[stable(feature = "rust1", since = "1.0.0")] pub u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] pub u8); + #[unstable(feature = "unstable_test_feature", issue = "none")] pub u8); diff --git a/src/test/ui/lint/auxiliary/stability-cfg2.rs b/src/test/ui/lint/auxiliary/stability-cfg2.rs index 8a2899584b9..c995038e5a8 100644 --- a/src/test/ui/lint/auxiliary/stability-cfg2.rs +++ b/src/test/ui/lint/auxiliary/stability-cfg2.rs @@ -1,5 +1,5 @@ // compile-flags:--cfg foo -#![cfg_attr(foo, unstable(feature = "unstable_test_feature", issue = "0"))] +#![cfg_attr(foo, unstable(feature = "unstable_test_feature", issue = "none"))] #![cfg_attr(not(foo), stable(feature = "test_feature", since = "1.0.0"))] #![feature(staged_api)] diff --git a/src/test/ui/lint/auxiliary/stability_cfg2.rs b/src/test/ui/lint/auxiliary/stability_cfg2.rs index 8a2899584b9..c995038e5a8 100644 --- a/src/test/ui/lint/auxiliary/stability_cfg2.rs +++ b/src/test/ui/lint/auxiliary/stability_cfg2.rs @@ -1,5 +1,5 @@ // compile-flags:--cfg foo -#![cfg_attr(foo, unstable(feature = "unstable_test_feature", issue = "0"))] +#![cfg_attr(foo, unstable(feature = "unstable_test_feature", issue = "none"))] #![cfg_attr(not(foo), stable(feature = "test_feature", since = "1.0.0"))] #![feature(staged_api)] diff --git a/src/test/ui/lint/lint-stability-2.rs b/src/test/ui/lint/lint-stability-2.rs index 53eee35a9ca..2a4f95f555f 100644 --- a/src/test/ui/lint/lint-stability-2.rs +++ b/src/test/ui/lint/lint-stability-2.rs @@ -168,16 +168,16 @@ mod cross_crate { } mod this_crate { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn deprecated() {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn deprecated_text() {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] pub fn unstable() {} - #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] + #[unstable(feature = "unstable_test_feature", reason = "text", issue = "none")] pub fn unstable_text() {} #[stable(feature = "rust1", since = "1.0.0")] @@ -189,16 +189,16 @@ mod this_crate { pub struct MethodTester; impl MethodTester { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn method_deprecated(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn method_deprecated_text(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] pub fn method_unstable(&self) {} - #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] + #[unstable(feature = "unstable_test_feature", reason = "text", issue = "none")] pub fn method_unstable_text(&self) {} #[stable(feature = "rust1", since = "1.0.0")] @@ -208,16 +208,16 @@ mod this_crate { } pub trait Trait { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn trait_deprecated(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn trait_deprecated_text(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] fn trait_unstable(&self) {} - #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] + #[unstable(feature = "unstable_test_feature", reason = "text", issue = "none")] fn trait_unstable_text(&self) {} #[stable(feature = "rust1", since = "1.0.0")] @@ -228,12 +228,12 @@ mod this_crate { impl Trait for MethodTester {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedStruct { #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] pub struct UnstableStruct { #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize } @@ -242,29 +242,29 @@ mod this_crate { #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedUnitStruct; - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] pub struct UnstableUnitStruct; #[stable(feature = "rust1", since = "1.0.0")] pub struct StableUnitStruct; pub enum Enum { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] DeprecatedVariant, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] UnstableVariant, #[stable(feature = "rust1", since = "1.0.0")] StableVariant, } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedTupleStruct(isize); - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] pub struct UnstableTupleStruct(isize); #[stable(feature = "rust1", since = "1.0.0")] pub struct StableTupleStruct(isize); @@ -381,7 +381,7 @@ mod this_crate { foo.trait_stable(); } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn test_fn_body() { fn fn_in_body() {} @@ -389,7 +389,7 @@ mod this_crate { } impl MethodTester { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn test_method_body(&self) { fn fn_in_body() {} @@ -397,7 +397,7 @@ mod this_crate { } } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub trait DeprecatedTrait { fn dummy(&self) { } diff --git a/src/test/ui/lint/lint-stability-deprecated.rs b/src/test/ui/lint/lint-stability-deprecated.rs index 5e747467a12..0585fec99b4 100644 --- a/src/test/ui/lint/lint-stability-deprecated.rs +++ b/src/test/ui/lint/lint-stability-deprecated.rs @@ -216,16 +216,16 @@ mod inheritance { } mod this_crate { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn deprecated() {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn deprecated_text() {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] pub fn unstable() {} - #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] + #[unstable(feature = "unstable_test_feature", reason = "text", issue = "none")] pub fn unstable_text() {} #[stable(feature = "rust1", since = "1.0.0")] @@ -237,16 +237,16 @@ mod this_crate { pub struct MethodTester; impl MethodTester { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn method_deprecated(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn method_deprecated_text(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] pub fn method_unstable(&self) {} - #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] + #[unstable(feature = "unstable_test_feature", reason = "text", issue = "none")] pub fn method_unstable_text(&self) {} #[stable(feature = "rust1", since = "1.0.0")] @@ -256,16 +256,16 @@ mod this_crate { } pub trait Trait { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn trait_deprecated(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn trait_deprecated_text(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] fn trait_unstable(&self) {} - #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] + #[unstable(feature = "unstable_test_feature", reason = "text", issue = "none")] fn trait_unstable_text(&self) {} #[stable(feature = "rust1", since = "1.0.0")] @@ -276,12 +276,12 @@ mod this_crate { impl Trait for MethodTester {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedStruct { #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] pub struct UnstableStruct { #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize } @@ -290,29 +290,29 @@ mod this_crate { #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedUnitStruct; - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] pub struct UnstableUnitStruct; #[stable(feature = "rust1", since = "1.0.0")] pub struct StableUnitStruct; pub enum Enum { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] DeprecatedVariant, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] UnstableVariant, #[stable(feature = "rust1", since = "1.0.0")] StableVariant, } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedTupleStruct(isize); - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] pub struct UnstableTupleStruct(isize); #[stable(feature = "rust1", since = "1.0.0")] pub struct StableTupleStruct(isize); @@ -430,7 +430,7 @@ mod this_crate { foo.trait_stable(); } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn test_fn_body() { fn fn_in_body() {} @@ -438,7 +438,7 @@ mod this_crate { } impl MethodTester { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn test_method_body(&self) { fn fn_in_body() {} @@ -446,7 +446,7 @@ mod this_crate { } } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub trait DeprecatedTrait { fn dummy(&self) { } diff --git a/src/test/ui/lint/lint-stability-fields-deprecated.rs b/src/test/ui/lint/lint-stability-fields-deprecated.rs index 9d5b7c51cc8..50e3970c7f0 100644 --- a/src/test/ui/lint/lint-stability-fields-deprecated.rs +++ b/src/test/ui/lint/lint-stability-fields-deprecated.rs @@ -153,50 +153,50 @@ mod this_crate { #[stable(feature = "rust1", since = "1.0.0")] struct Stable { inherit: u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] override1: u8, #[rustc_deprecated(since = "1.0.0", reason = "text")] - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] override2: u8, } #[stable(feature = "rust1", since = "1.0.0")] struct Stable2(u8, #[stable(feature = "rust1", since = "1.0.0")] u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] u8); - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] struct Unstable { inherit: u8, #[stable(feature = "rust1", since = "1.0.0")] override1: u8, #[rustc_deprecated(since = "1.0.0", reason = "text")] - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] override2: u8, } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] struct Unstable2(u8, #[stable(feature = "rust1", since = "1.0.0")] u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] u8); - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] struct Deprecated { inherit: u8, #[stable(feature = "rust1", since = "1.0.0")] override1: u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] override2: u8, } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] struct Deprecated2(u8, #[stable(feature = "rust1", since = "1.0.0")] u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] u8); + #[unstable(feature = "unstable_test_feature", issue = "none")] u8); pub fn foo() { let x = Stable { diff --git a/src/test/ui/lint/lint-stability-fields.rs b/src/test/ui/lint/lint-stability-fields.rs index 9be8710bd4c..c5de5748aa3 100644 --- a/src/test/ui/lint/lint-stability-fields.rs +++ b/src/test/ui/lint/lint-stability-fields.rs @@ -128,50 +128,50 @@ mod this_crate { #[stable(feature = "rust1", since = "1.0.0")] struct Stable { inherit: u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] override1: u8, #[rustc_deprecated(since = "1.0.0", reason = "text")] - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] override2: u8, } #[stable(feature = "rust1", since = "1.0.0")] struct Stable2(u8, #[stable(feature = "rust1", since = "1.0.0")] u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] u8); - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] struct Unstable { inherit: u8, #[stable(feature = "rust1", since = "1.0.0")] override1: u8, #[rustc_deprecated(since = "1.0.0", reason = "text")] - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] override2: u8, } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] struct Unstable2(u8, #[stable(feature = "rust1", since = "1.0.0")] u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] u8); - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] struct Deprecated { inherit: u8, #[stable(feature = "rust1", since = "1.0.0")] override1: u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] override2: u8, } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] struct Deprecated2(u8, #[stable(feature = "rust1", since = "1.0.0")] u8, - #[unstable(feature = "unstable_test_feature", issue = "0")] u8); + #[unstable(feature = "unstable_test_feature", issue = "none")] u8); pub fn foo() { let x = Stable { diff --git a/src/test/ui/lint/lint-stability.rs b/src/test/ui/lint/lint-stability.rs index fde27eec7d3..e5620a9f8e7 100644 --- a/src/test/ui/lint/lint-stability.rs +++ b/src/test/ui/lint/lint-stability.rs @@ -203,10 +203,10 @@ mod inheritance { } mod this_crate { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn deprecated() {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn deprecated_text() {} @@ -214,9 +214,9 @@ mod this_crate { #[rustc_deprecated(since = "99.99.99", reason = "text")] pub fn deprecated_future() {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] pub fn unstable() {} - #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] + #[unstable(feature = "unstable_test_feature", reason = "text", issue = "none")] pub fn unstable_text() {} #[stable(feature = "rust1", since = "1.0.0")] @@ -228,16 +228,16 @@ mod this_crate { pub struct MethodTester; impl MethodTester { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn method_deprecated(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub fn method_deprecated_text(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] pub fn method_unstable(&self) {} - #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] + #[unstable(feature = "unstable_test_feature", reason = "text", issue = "none")] pub fn method_unstable_text(&self) {} #[stable(feature = "rust1", since = "1.0.0")] @@ -247,16 +247,16 @@ mod this_crate { } pub trait Trait { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn trait_deprecated(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn trait_deprecated_text(&self) {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] fn trait_unstable(&self) {} - #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] + #[unstable(feature = "unstable_test_feature", reason = "text", issue = "none")] fn trait_unstable_text(&self) {} #[stable(feature = "rust1", since = "1.0.0")] @@ -267,12 +267,12 @@ mod this_crate { impl Trait for MethodTester {} - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedStruct { #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] pub struct UnstableStruct { #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize } @@ -281,29 +281,29 @@ mod this_crate { #[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedUnitStruct; - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] pub struct UnstableUnitStruct; #[stable(feature = "rust1", since = "1.0.0")] pub struct StableUnitStruct; pub enum Enum { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] DeprecatedVariant, - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] UnstableVariant, #[stable(feature = "rust1", since = "1.0.0")] StableVariant, } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub struct DeprecatedTupleStruct(isize); - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] pub struct UnstableTupleStruct(isize); #[stable(feature = "rust1", since = "1.0.0")] pub struct StableTupleStruct(isize); @@ -422,7 +422,7 @@ mod this_crate { foo.trait_stable(); } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn test_fn_body() { fn fn_in_body() {} @@ -430,7 +430,7 @@ mod this_crate { } impl MethodTester { - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] fn test_method_body(&self) { fn fn_in_body() {} @@ -438,7 +438,7 @@ mod this_crate { } } - #[unstable(feature = "unstable_test_feature", issue = "0")] + #[unstable(feature = "unstable_test_feature", issue = "none")] #[rustc_deprecated(since = "1.0.0", reason = "text")] pub trait DeprecatedTrait { fn dummy(&self) { } diff --git a/src/test/ui/macros/auxiliary/unstable-macros.rs b/src/test/ui/macros/auxiliary/unstable-macros.rs index e928dc705d7..123e244a53e 100644 --- a/src/test/ui/macros/auxiliary/unstable-macros.rs +++ b/src/test/ui/macros/auxiliary/unstable-macros.rs @@ -2,7 +2,7 @@ #![feature(staged_api)] #![stable(feature = "unit_test", since = "1.0.0")] -#[unstable(feature = "unstable_macros", issue = "0")] +#[unstable(feature = "unstable_macros", issue = "none")] #[macro_export] macro_rules! unstable_macro{ () => () } @@ -12,5 +12,5 @@ macro_rules! unstable_macro{ () => () } macro_rules! deprecated_macro{ () => () } // FIXME: Cannot use a `pub` macro 2.0 in a staged API crate due to reachability issues. -// #[unstable(feature = "unstable_macros", issue = "0")] +// #[unstable(feature = "unstable_macros", issue = "none")] // pub macro unstable_macro_modern() {} diff --git a/src/test/ui/macros/macro-stability-rpass.rs b/src/test/ui/macros/macro-stability-rpass.rs index 817bddf6956..a5f538ba6b3 100644 --- a/src/test/ui/macros/macro-stability-rpass.rs +++ b/src/test/ui/macros/macro-stability-rpass.rs @@ -5,7 +5,7 @@ #[macro_use] extern crate unstable_macros; -#[unstable(feature = "local_unstable", issue = "0")] +#[unstable(feature = "local_unstable", issue = "none")] macro_rules! local_unstable { () => () } fn main() { diff --git a/src/test/ui/macros/macro-stability.rs b/src/test/ui/macros/macro-stability.rs index ab927e419b4..755f55c28de 100644 --- a/src/test/ui/macros/macro-stability.rs +++ b/src/test/ui/macros/macro-stability.rs @@ -4,10 +4,10 @@ #![feature(staged_api)] #[macro_use] extern crate unstable_macros; -#[unstable(feature = "local_unstable", issue = "0")] +#[unstable(feature = "local_unstable", issue = "none")] macro_rules! local_unstable { () => () } -#[unstable(feature = "local_unstable", issue = "0")] +#[unstable(feature = "local_unstable", issue = "none")] macro local_unstable_modern() {} #[stable(feature = "deprecated_macros", since = "1.0.0")] diff --git a/src/test/ui/missing/missing-stability.rs b/src/test/ui/missing/missing-stability.rs index 469c22fdb17..0da5808b47d 100644 --- a/src/test/ui/missing/missing-stability.rs +++ b/src/test/ui/missing/missing-stability.rs @@ -10,7 +10,7 @@ pub fn unmarked() { () } -#[unstable(feature = "unstable_test_feature", issue = "0")] +#[unstable(feature = "unstable_test_feature", issue = "none")] pub mod foo { // #[unstable] is inherited pub fn unmarked() {} diff --git a/src/test/ui/stability-attribute/stability-attribute-sanity.rs b/src/test/ui/stability-attribute/stability-attribute-sanity.rs index 2e3d790d2d8..5db924642e5 100644 --- a/src/test/ui/stability-attribute/stability-attribute-sanity.rs +++ b/src/test/ui/stability-attribute/stability-attribute-sanity.rs @@ -22,7 +22,7 @@ mod bogus_attribute_types_1 { } mod missing_feature_names { - #[unstable(issue = "0")] //~ ERROR missing 'feature' [E0546] + #[unstable(issue = "none")] //~ ERROR missing 'feature' [E0546] fn f1() { } #[unstable(feature = "b")] //~ ERROR missing 'issue' [E0547] @@ -45,12 +45,12 @@ mod missing_version { fn f3() { } } -#[unstable(feature = "b", issue = "0")] +#[unstable(feature = "b", issue = "none")] #[stable(feature = "a", since = "b")] //~ ERROR multiple stability levels [E0544] fn multiple1() { } -#[unstable(feature = "b", issue = "0")] -#[unstable(feature = "b", issue = "0")] //~ ERROR multiple stability levels [E0544] +#[unstable(feature = "b", issue = "none")] +#[unstable(feature = "b", issue = "none")] //~ ERROR multiple stability levels [E0544] fn multiple2() { } #[stable(feature = "a", since = "b")] @@ -60,8 +60,8 @@ fn multiple3() { } #[stable(feature = "a", since = "b")] #[rustc_deprecated(since = "b", reason = "text")] #[rustc_deprecated(since = "b", reason = "text")] -#[rustc_const_unstable(feature = "c", issue = "0")] -#[rustc_const_unstable(feature = "d", issue = "0")] //~ ERROR multiple stability levels +#[rustc_const_unstable(feature = "c", issue = "none")] +#[rustc_const_unstable(feature = "d", issue = "none")] //~ ERROR multiple stability levels pub const fn multiple4() { } //~ ERROR multiple rustc_deprecated attributes [E0540] //~^ ERROR Invalid stability or deprecation version found diff --git a/src/test/ui/stability-attribute/stability-attribute-sanity.stderr b/src/test/ui/stability-attribute/stability-attribute-sanity.stderr index 552e078f45f..d0ca1705037 100644 --- a/src/test/ui/stability-attribute/stability-attribute-sanity.stderr +++ b/src/test/ui/stability-attribute/stability-attribute-sanity.stderr @@ -31,8 +31,8 @@ LL | #[stable(feature(b), since = "a")] error[E0546]: missing 'feature' --> $DIR/stability-attribute-sanity.rs:25:5 | -LL | #[unstable(issue = "0")] - | ^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[unstable(issue = "none")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0547]: missing 'issue' --> $DIR/stability-attribute-sanity.rs:28:5 @@ -73,8 +73,8 @@ LL | #[stable(feature = "a", since = "b")] error[E0544]: multiple stability levels --> $DIR/stability-attribute-sanity.rs:53:1 | -LL | #[unstable(feature = "b", issue = "0")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[unstable(feature = "b", issue = "none")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0544]: multiple stability levels --> $DIR/stability-attribute-sanity.rs:57:1 @@ -91,8 +91,8 @@ LL | pub const fn multiple4() { } error[E0544]: multiple stability levels --> $DIR/stability-attribute-sanity.rs:64:1 | -LL | #[rustc_const_unstable(feature = "d", issue = "0")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_const_unstable(feature = "d", issue = "none")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: Invalid stability or deprecation version found --> $DIR/stability-attribute-sanity.rs:65:1 -- cgit 1.4.1-3-g733a5 From 3b1fab8c1f0ef78d90fd27d8ec0e6950c050d259 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Sun, 8 Dec 2019 09:08:19 +0100 Subject: parse_ty_common: .fatal -> .struct_span_err --- src/librustc_parse/parser/ty.rs | 2 +- src/test/ui/type/ascription/issue-47666.stderr | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/test') diff --git a/src/librustc_parse/parser/ty.rs b/src/librustc_parse/parser/ty.rs index 840461d75be..d9938a81240 100644 --- a/src/librustc_parse/parser/ty.rs +++ b/src/librustc_parse/parser/ty.rs @@ -133,7 +133,7 @@ impl<'a> Parser<'a> { } } else { let msg = format!("expected type, found {}", self.this_token_descr()); - let mut err = self.fatal(&msg); + let mut err = self.struct_span_err(self.token.span, &msg); err.span_label(self.token.span, "expected type"); self.maybe_annotate_with_ascription(&mut err, true); return Err(err); diff --git a/src/test/ui/type/ascription/issue-47666.stderr b/src/test/ui/type/ascription/issue-47666.stderr index 2f052341fae..648635f0c32 100644 --- a/src/test/ui/type/ascription/issue-47666.stderr +++ b/src/test/ui/type/ascription/issue-47666.stderr @@ -11,7 +11,7 @@ LL | let _ = Option:Some(vec![0, 1]); | = note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `: ` = note: for more information, see https://github.com/rust-lang/rust/issues/23416 - = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: aborting due to previous error -- cgit 1.4.1-3-g733a5 From b5f00beaa5a77ff8bccbe4330ea0b5047661cbf5 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Sun, 8 Dec 2019 12:19:53 +0100 Subject: parse_generic_bounds: account for negative lifetime bounds --- src/librustc_parse/parser/ty.rs | 35 ++++++++++------------ src/test/ui/issues/issue-58857.rs | 2 +- src/test/ui/issues/issue-58857.stderr | 6 ++-- src/test/ui/parser/issue-33418.fixed | 10 +++---- src/test/ui/parser/issue-33418.rs | 10 +++---- src/test/ui/parser/issue-33418.stderr | 30 +++++++++---------- ...67146-negative-outlives-bound-syntactic-fail.rs | 12 ++++++++ ...6-negative-outlives-bound-syntactic-fail.stderr | 26 ++++++++++++++++ 8 files changed, 83 insertions(+), 48 deletions(-) create mode 100644 src/test/ui/parser/issue-67146-negative-outlives-bound-syntactic-fail.rs create mode 100644 src/test/ui/parser/issue-67146-negative-outlives-bound-syntactic-fail.stderr (limited to 'src/test') diff --git a/src/librustc_parse/parser/ty.rs b/src/librustc_parse/parser/ty.rs index c9722045875..db9a0ada525 100644 --- a/src/librustc_parse/parser/ty.rs +++ b/src/librustc_parse/parser/ty.rs @@ -375,9 +375,9 @@ impl<'a> Parser<'a> { let last_span = *negative_bounds.last().unwrap(); let mut err = self.struct_span_err( negative_bounds, - "negative trait bounds are not supported", + "negative bounds are not supported", ); - err.span_label(last_span, "negative trait bounds are not supported"); + err.span_label(last_span, "negative bounds are not supported"); if let Some(bound_list) = colon_span { let bound_list = bound_list.to(self.prev_span); let mut new_bound_list = String::new(); @@ -392,7 +392,7 @@ impl<'a> Parser<'a> { } err.span_suggestion_hidden( bound_list, - &format!("remove the trait bound{}", pluralize!(negative_bounds_len)), + &format!("remove the bound{}", pluralize!(negative_bounds_len)), new_bound_list, Applicability::MachineApplicable, ); @@ -418,25 +418,23 @@ impl<'a> Parser<'a> { /// ``` /// BOUND = TY_BOUND | LT_BOUND /// ``` - fn parse_generic_bound( - &mut self, - ) -> PResult<'a, Result> { + fn parse_generic_bound(&mut self) -> PResult<'a, Result> { let anchor_lo = self.prev_span; let lo = self.token.span; let has_parens = self.eat(&token::OpenDelim(token::Paren)); let inner_lo = self.token.span; let is_negative = self.eat(&token::Not); let question = self.eat(&token::Question).then_some(self.prev_span); - if self.token.is_lifetime() { - Ok(Ok(self.parse_generic_lt_bound(lo, inner_lo, has_parens, question)?)) + let bound = if self.token.is_lifetime() { + self.parse_generic_lt_bound(lo, inner_lo, has_parens, question)? } else { - let (poly_span, bound) = self.parse_generic_ty_bound(lo, has_parens, question)?; - if is_negative { - Ok(Err(anchor_lo.to(poly_span))) - } else { - Ok(Ok(bound)) - } - } + self.parse_generic_ty_bound(lo, has_parens, question)? + }; + Ok(if is_negative { + Err(anchor_lo.to(self.prev_span)) + } else { + Ok(bound) + }) } /// Parses a lifetime ("outlives") bound, e.g. `'a`, according to: @@ -497,16 +495,15 @@ impl<'a> Parser<'a> { lo: Span, has_parens: bool, question: Option, - ) -> PResult<'a, (Span, GenericBound)> { + ) -> PResult<'a, GenericBound> { let lifetime_defs = self.parse_late_bound_lifetime_defs()?; let path = self.parse_path(PathStyle::Type)?; if has_parens { self.expect(&token::CloseDelim(token::Paren))?; } - let poly_span = lo.to(self.prev_span); - let poly_trait = PolyTraitRef::new(lifetime_defs, path, poly_span); + let poly_trait = PolyTraitRef::new(lifetime_defs, path, lo.to(self.prev_span)); let modifier = question.map_or(TraitBoundModifier::None, |_| TraitBoundModifier::Maybe); - Ok((poly_span, GenericBound::Trait(poly_trait, modifier))) + Ok(GenericBound::Trait(poly_trait, modifier)) } pub(super) fn parse_late_bound_lifetime_defs(&mut self) -> PResult<'a, Vec> { diff --git a/src/test/ui/issues/issue-58857.rs b/src/test/ui/issues/issue-58857.rs index 392e4ea0c2e..4350d7e5b40 100644 --- a/src/test/ui/issues/issue-58857.rs +++ b/src/test/ui/issues/issue-58857.rs @@ -2,6 +2,6 @@ struct Conj {a : A} trait Valid {} impl Conj{} -//~^ ERROR negative trait bounds are not supported +//~^ ERROR negative bounds are not supported fn main() {} diff --git a/src/test/ui/issues/issue-58857.stderr b/src/test/ui/issues/issue-58857.stderr index ab9a0130c00..9bc80cc270b 100644 --- a/src/test/ui/issues/issue-58857.stderr +++ b/src/test/ui/issues/issue-58857.stderr @@ -1,10 +1,10 @@ -error: negative trait bounds are not supported +error: negative bounds are not supported --> $DIR/issue-58857.rs:4:7 | LL | impl Conj{} - | ^^^^^^^^ negative trait bounds are not supported + | ^^^^^^^^ negative bounds are not supported | - = help: remove the trait bound + = help: remove the bound error: aborting due to previous error diff --git a/src/test/ui/parser/issue-33418.fixed b/src/test/ui/parser/issue-33418.fixed index 2aaa3b5b1ea..ed885ae1435 100644 --- a/src/test/ui/parser/issue-33418.fixed +++ b/src/test/ui/parser/issue-33418.fixed @@ -1,15 +1,15 @@ // run-rustfix trait Tr {} -//~^ ERROR negative trait bounds are not supported +//~^ ERROR negative bounds are not supported trait Tr2: SuperA {} -//~^ ERROR negative trait bounds are not supported +//~^ ERROR negative bounds are not supported trait Tr3: SuperB {} -//~^ ERROR negative trait bounds are not supported +//~^ ERROR negative bounds are not supported trait Tr4: SuperB + SuperD {} -//~^ ERROR negative trait bounds are not supported +//~^ ERROR negative bounds are not supported trait Tr5 {} -//~^ ERROR negative trait bounds are not supported +//~^ ERROR negative bounds are not supported trait SuperA {} trait SuperB {} diff --git a/src/test/ui/parser/issue-33418.rs b/src/test/ui/parser/issue-33418.rs index 55331520927..9934284abfb 100644 --- a/src/test/ui/parser/issue-33418.rs +++ b/src/test/ui/parser/issue-33418.rs @@ -1,17 +1,17 @@ // run-rustfix trait Tr: !SuperA {} -//~^ ERROR negative trait bounds are not supported +//~^ ERROR negative bounds are not supported trait Tr2: SuperA + !SuperB {} -//~^ ERROR negative trait bounds are not supported +//~^ ERROR negative bounds are not supported trait Tr3: !SuperA + SuperB {} -//~^ ERROR negative trait bounds are not supported +//~^ ERROR negative bounds are not supported trait Tr4: !SuperA + SuperB + !SuperC + SuperD {} -//~^ ERROR negative trait bounds are not supported +//~^ ERROR negative bounds are not supported trait Tr5: !SuperA + !SuperB {} -//~^ ERROR negative trait bounds are not supported +//~^ ERROR negative bounds are not supported trait SuperA {} trait SuperB {} diff --git a/src/test/ui/parser/issue-33418.stderr b/src/test/ui/parser/issue-33418.stderr index 479e7bed101..7f361dbe271 100644 --- a/src/test/ui/parser/issue-33418.stderr +++ b/src/test/ui/parser/issue-33418.stderr @@ -1,46 +1,46 @@ -error: negative trait bounds are not supported +error: negative bounds are not supported --> $DIR/issue-33418.rs:3:9 | LL | trait Tr: !SuperA {} - | ^^^^^^^^^ negative trait bounds are not supported + | ^^^^^^^^^ negative bounds are not supported | - = help: remove the trait bound + = help: remove the bound -error: negative trait bounds are not supported +error: negative bounds are not supported --> $DIR/issue-33418.rs:5:19 | LL | trait Tr2: SuperA + !SuperB {} - | ^^^^^^^^^ negative trait bounds are not supported + | ^^^^^^^^^ negative bounds are not supported | - = help: remove the trait bound + = help: remove the bound -error: negative trait bounds are not supported +error: negative bounds are not supported --> $DIR/issue-33418.rs:7:10 | LL | trait Tr3: !SuperA + SuperB {} - | ^^^^^^^^^ negative trait bounds are not supported + | ^^^^^^^^^ negative bounds are not supported | - = help: remove the trait bound + = help: remove the bound -error: negative trait bounds are not supported +error: negative bounds are not supported --> $DIR/issue-33418.rs:9:10 | LL | trait Tr4: !SuperA + SuperB | ^^^^^^^^^ LL | + !SuperC + SuperD {} - | ^^^^^^^^^ negative trait bounds are not supported + | ^^^^^^^^^ negative bounds are not supported | - = help: remove the trait bounds + = help: remove the bounds -error: negative trait bounds are not supported +error: negative bounds are not supported --> $DIR/issue-33418.rs:12:10 | LL | trait Tr5: !SuperA | ^^^^^^^^^ LL | + !SuperB {} - | ^^^^^^^^^ negative trait bounds are not supported + | ^^^^^^^^^ negative bounds are not supported | - = help: remove the trait bounds + = help: remove the bounds error: aborting due to 5 previous errors diff --git a/src/test/ui/parser/issue-67146-negative-outlives-bound-syntactic-fail.rs b/src/test/ui/parser/issue-67146-negative-outlives-bound-syntactic-fail.rs new file mode 100644 index 00000000000..5a109ba7c68 --- /dev/null +++ b/src/test/ui/parser/issue-67146-negative-outlives-bound-syntactic-fail.rs @@ -0,0 +1,12 @@ +// In this regression test for #67146, we check that the +// negative outlives bound `!'a` is rejected by the parser. +// This regression was first introduced in PR #57364. + +fn main() {} + +fn f1() {} +//~^ ERROR negative bounds are not supported +fn f2<'a, T: Ord + !'a>() {} +//~^ ERROR negative bounds are not supported +fn f3<'a, T: !'a + Ord>() {} +//~^ ERROR negative bounds are not supported diff --git a/src/test/ui/parser/issue-67146-negative-outlives-bound-syntactic-fail.stderr b/src/test/ui/parser/issue-67146-negative-outlives-bound-syntactic-fail.stderr new file mode 100644 index 00000000000..74437c1a008 --- /dev/null +++ b/src/test/ui/parser/issue-67146-negative-outlives-bound-syntactic-fail.stderr @@ -0,0 +1,26 @@ +error: negative bounds are not supported + --> $DIR/issue-67146-negative-outlives-bound-syntactic-fail.rs:7:8 + | +LL | fn f1() {} + | ^^^^^^^^^^ negative bounds are not supported + | + = help: remove the bound + +error: negative bounds are not supported + --> $DIR/issue-67146-negative-outlives-bound-syntactic-fail.rs:9:18 + | +LL | fn f2<'a, T: Ord + !'a>() {} + | ^^^^^ negative bounds are not supported + | + = help: remove the bound + +error: negative bounds are not supported + --> $DIR/issue-67146-negative-outlives-bound-syntactic-fail.rs:11:12 + | +LL | fn f3<'a, T: !'a + Ord>() {} + | ^^^^^ negative bounds are not supported + | + = help: remove the bound + +error: aborting due to 3 previous errors + -- cgit 1.4.1-3-g733a5 From db4818f3253254bafac707d58ec3d13def0e6f86 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Sat, 21 Dec 2019 03:32:54 +0100 Subject: span_suggestion_hidden -> tool_only_span_suggestion --- src/librustc_parse/parser/ty.rs | 2 +- src/test/ui/issues/issue-58857.stderr | 2 -- src/test/ui/parser/issue-33418.stderr | 10 ---------- .../issue-67146-negative-outlives-bound-syntactic-fail.stderr | 6 ------ 4 files changed, 1 insertion(+), 19 deletions(-) (limited to 'src/test') diff --git a/src/librustc_parse/parser/ty.rs b/src/librustc_parse/parser/ty.rs index b83ec71124d..9f5fd6d0a36 100644 --- a/src/librustc_parse/parser/ty.rs +++ b/src/librustc_parse/parser/ty.rs @@ -407,7 +407,7 @@ impl<'a> Parser<'a> { } new_bound_list = new_bound_list.replacen(" +", ":", 1); } - err.span_suggestion_hidden( + err.tool_only_span_suggestion( bound_list, &format!("remove the bound{}", pluralize!(negative_bounds_len)), new_bound_list, diff --git a/src/test/ui/issues/issue-58857.stderr b/src/test/ui/issues/issue-58857.stderr index 9bc80cc270b..e2acec47e5a 100644 --- a/src/test/ui/issues/issue-58857.stderr +++ b/src/test/ui/issues/issue-58857.stderr @@ -3,8 +3,6 @@ error: negative bounds are not supported | LL | impl Conj{} | ^^^^^^^^ negative bounds are not supported - | - = help: remove the bound error: aborting due to previous error diff --git a/src/test/ui/parser/issue-33418.stderr b/src/test/ui/parser/issue-33418.stderr index 7f361dbe271..9a8733e8929 100644 --- a/src/test/ui/parser/issue-33418.stderr +++ b/src/test/ui/parser/issue-33418.stderr @@ -3,24 +3,18 @@ error: negative bounds are not supported | LL | trait Tr: !SuperA {} | ^^^^^^^^^ negative bounds are not supported - | - = help: remove the bound error: negative bounds are not supported --> $DIR/issue-33418.rs:5:19 | LL | trait Tr2: SuperA + !SuperB {} | ^^^^^^^^^ negative bounds are not supported - | - = help: remove the bound error: negative bounds are not supported --> $DIR/issue-33418.rs:7:10 | LL | trait Tr3: !SuperA + SuperB {} | ^^^^^^^^^ negative bounds are not supported - | - = help: remove the bound error: negative bounds are not supported --> $DIR/issue-33418.rs:9:10 @@ -29,8 +23,6 @@ LL | trait Tr4: !SuperA + SuperB | ^^^^^^^^^ LL | + !SuperC + SuperD {} | ^^^^^^^^^ negative bounds are not supported - | - = help: remove the bounds error: negative bounds are not supported --> $DIR/issue-33418.rs:12:10 @@ -39,8 +31,6 @@ LL | trait Tr5: !SuperA | ^^^^^^^^^ LL | + !SuperB {} | ^^^^^^^^^ negative bounds are not supported - | - = help: remove the bounds error: aborting due to 5 previous errors diff --git a/src/test/ui/parser/issue-67146-negative-outlives-bound-syntactic-fail.stderr b/src/test/ui/parser/issue-67146-negative-outlives-bound-syntactic-fail.stderr index 74437c1a008..4dc06347304 100644 --- a/src/test/ui/parser/issue-67146-negative-outlives-bound-syntactic-fail.stderr +++ b/src/test/ui/parser/issue-67146-negative-outlives-bound-syntactic-fail.stderr @@ -3,24 +3,18 @@ error: negative bounds are not supported | LL | fn f1() {} | ^^^^^^^^^^ negative bounds are not supported - | - = help: remove the bound error: negative bounds are not supported --> $DIR/issue-67146-negative-outlives-bound-syntactic-fail.rs:9:18 | LL | fn f2<'a, T: Ord + !'a>() {} | ^^^^^ negative bounds are not supported - | - = help: remove the bound error: negative bounds are not supported --> $DIR/issue-67146-negative-outlives-bound-syntactic-fail.rs:11:12 | LL | fn f3<'a, T: !'a + Ord>() {} | ^^^^^ negative bounds are not supported - | - = help: remove the bound error: aborting due to 3 previous errors -- cgit 1.4.1-3-g733a5 From 30e84b02446e9906595e3053f537162c96fc7722 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Sun, 22 Dec 2019 07:59:38 +0900 Subject: Tweak non_shorthand_field_patterns' suggestion --- src/librustc_lint/builtin.rs | 23 ++++++--- src/test/ui/lint/lint-shorthand-field.fixed | 70 ++++++++++++++++++++++++++++ src/test/ui/lint/lint-shorthand-field.rs | 18 ++++++- src/test/ui/lint/lint-shorthand-field.stderr | 34 ++++++++++---- src/test/ui/lint/suggestions.rs | 2 +- src/test/ui/lint/suggestions.stderr | 4 +- 6 files changed, 129 insertions(+), 22 deletions(-) create mode 100644 src/test/ui/lint/lint-shorthand-field.fixed (limited to 'src/test') diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index 4cf694631d0..6461263bf51 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -174,18 +174,27 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonShorthandFieldPatterns { // (Issue #49588) continue; } - if let PatKind::Binding(_, _, ident, None) = fieldpat.pat.kind { + if let PatKind::Binding(binding_annot, _, ident, None) = fieldpat.pat.kind { if cx.tcx.find_field_index(ident, &variant) == Some(cx.tcx.field_index(fieldpat.hir_id, cx.tables)) { let mut err = cx.struct_span_lint(NON_SHORTHAND_FIELD_PATTERNS, fieldpat.span, &format!("the `{}:` in this pattern is redundant", ident)); - let subspan = cx.tcx.sess.source_map().span_through_char(fieldpat.span, - ':'); - err.span_suggestion_short( - subspan, - "remove this", - ident.to_string(), + let binding = match binding_annot { + hir::BindingAnnotation::Unannotated => None, + hir::BindingAnnotation::Mutable => Some("mut"), + hir::BindingAnnotation::Ref => Some("ref"), + hir::BindingAnnotation::RefMut => Some("ref mut"), + }; + let ident = if let Some(binding) = binding { + format!("{} {}", binding, ident) + } else { + ident.to_string() + }; + err.span_suggestion( + fieldpat.span, + "use shorthand field pattern", + ident, Applicability::MachineApplicable ); err.emit(); diff --git a/src/test/ui/lint/lint-shorthand-field.fixed b/src/test/ui/lint/lint-shorthand-field.fixed new file mode 100644 index 00000000000..7cd5717bc5a --- /dev/null +++ b/src/test/ui/lint/lint-shorthand-field.fixed @@ -0,0 +1,70 @@ +// run-rustfix + +#![allow(nonstandard_style, unused_variables, unused_mut)] +#![deny(non_shorthand_field_patterns)] + +struct Foo { + x: isize, + y: isize, +} + +fn main() { + { + let Foo { + x, //~ ERROR the `x:` in this pattern is redundant + ref y, //~ ERROR the `y:` in this pattern is redundant + } = Foo { x: 0, y: 0 }; + + let Foo { + x, + ref y, + } = Foo { x: 0, y: 0 }; + } + + { + const x: isize = 1; + + match (Foo { x: 1, y: 1 }) { + Foo { x: x, ..} => {}, + _ => {}, + } + } + + { + struct Bar { + x: x, + } + + struct x; + + match (Bar { x: x }) { + Bar { x: x } => {}, + } + } + + { + struct Bar { + x: Foo, + } + + enum Foo { x } + + match (Bar { x: Foo::x }) { + Bar { x: Foo::x } => {}, + } + } + + { + struct Baz { + x: isize, + y: isize, + z: isize, + } + + let Baz { + mut x, //~ ERROR the `x:` in this pattern is redundant + ref y, //~ ERROR the `y:` in this pattern is redundant + ref mut z, //~ ERROR the `z:` in this pattern is redundant + } = Baz { x: 0, y: 0, z: 0 }; + } +} diff --git a/src/test/ui/lint/lint-shorthand-field.rs b/src/test/ui/lint/lint-shorthand-field.rs index 5e756d14dc8..22de9c32545 100644 --- a/src/test/ui/lint/lint-shorthand-field.rs +++ b/src/test/ui/lint/lint-shorthand-field.rs @@ -1,4 +1,6 @@ -#![allow(nonstandard_style, unused_variables)] +// run-rustfix + +#![allow(nonstandard_style, unused_variables, unused_mut)] #![deny(non_shorthand_field_patterns)] struct Foo { @@ -51,4 +53,18 @@ fn main() { Bar { x: Foo::x } => {}, } } + + { + struct Baz { + x: isize, + y: isize, + z: isize, + } + + let Baz { + x: mut x, //~ ERROR the `x:` in this pattern is redundant + y: ref y, //~ ERROR the `y:` in this pattern is redundant + z: ref mut z, //~ ERROR the `z:` in this pattern is redundant + } = Baz { x: 0, y: 0, z: 0 }; + } } diff --git a/src/test/ui/lint/lint-shorthand-field.stderr b/src/test/ui/lint/lint-shorthand-field.stderr index 366ab55d7d4..5c9b21ffdc7 100644 --- a/src/test/ui/lint/lint-shorthand-field.stderr +++ b/src/test/ui/lint/lint-shorthand-field.stderr @@ -1,24 +1,38 @@ error: the `x:` in this pattern is redundant - --> $DIR/lint-shorthand-field.rs:12:13 + --> $DIR/lint-shorthand-field.rs:14:13 | LL | x: x, - | --^^ - | | - | help: remove this + | ^^^^ help: use shorthand field pattern: `x` | note: lint level defined here - --> $DIR/lint-shorthand-field.rs:2:9 + --> $DIR/lint-shorthand-field.rs:4:9 | LL | #![deny(non_shorthand_field_patterns)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: the `y:` in this pattern is redundant - --> $DIR/lint-shorthand-field.rs:13:13 + --> $DIR/lint-shorthand-field.rs:15:13 | LL | y: ref y, - | --^^^^^^ - | | - | help: remove this + | ^^^^^^^^ help: use shorthand field pattern: `ref y` -error: aborting due to 2 previous errors +error: the `x:` in this pattern is redundant + --> $DIR/lint-shorthand-field.rs:65:13 + | +LL | x: mut x, + | ^^^^^^^^ help: use shorthand field pattern: `mut x` + +error: the `y:` in this pattern is redundant + --> $DIR/lint-shorthand-field.rs:66:13 + | +LL | y: ref y, + | ^^^^^^^^ help: use shorthand field pattern: `ref y` + +error: the `z:` in this pattern is redundant + --> $DIR/lint-shorthand-field.rs:67:13 + | +LL | z: ref mut z, + | ^^^^^^^^^^^^ help: use shorthand field pattern: `ref mut z` + +error: aborting due to 5 previous errors diff --git a/src/test/ui/lint/suggestions.rs b/src/test/ui/lint/suggestions.rs index aa5518d1a7a..29297d08dca 100644 --- a/src/test/ui/lint/suggestions.rs +++ b/src/test/ui/lint/suggestions.rs @@ -60,7 +60,7 @@ fn main() { match d { Equinox { warp_factor: warp_factor } => {} //~^ WARN this pattern is redundant - //~| HELP remove this + //~| HELP use shorthand field pattern } println!("{} {}", registry_no, b); } diff --git a/src/test/ui/lint/suggestions.stderr b/src/test/ui/lint/suggestions.stderr index 2042ed75537..e42ee0fa640 100644 --- a/src/test/ui/lint/suggestions.stderr +++ b/src/test/ui/lint/suggestions.stderr @@ -77,9 +77,7 @@ warning: the `warp_factor:` in this pattern is redundant --> $DIR/suggestions.rs:61:23 | LL | Equinox { warp_factor: warp_factor } => {} - | ------------^^^^^^^^^^^^ - | | - | help: remove this + | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use shorthand field pattern: `warp_factor` | = note: `#[warn(non_shorthand_field_patterns)]` on by default -- cgit 1.4.1-3-g733a5