diff options
| author | Jacob Pratt <jacob@jhpratt.dev> | 2022-02-15 02:00:21 -0500 |
|---|---|---|
| committer | Jacob Pratt <jacob@jhpratt.dev> | 2022-03-04 18:15:49 -0500 |
| commit | 6efc8e34d8b83de7f5b1e47d4bbbe0f2daa385f8 (patch) | |
| tree | 3584fabe76f9318369a15ea1e88dc057c4a345b7 /src/test/ui/stability-attribute | |
| parent | 9fcbc32053d5084d1de79bd484de82474cdae427 (diff) | |
| download | rust-6efc8e34d8b83de7f5b1e47d4bbbe0f2daa385f8.tar.gz rust-6efc8e34d8b83de7f5b1e47d4bbbe0f2daa385f8.zip | |
Change `rustc_deprecated` to use `note`
This keeps `reason` around for the time being. This is necessary to avoid breakage during the bootstrap process. This change, as a whole, brings `#[rustc_deprecated]` more in line with `#[deprecated]`.
Diffstat (limited to 'src/test/ui/stability-attribute')
5 files changed, 46 insertions, 46 deletions
diff --git a/src/test/ui/stability-attribute/auxiliary/lint-stability.rs b/src/test/ui/stability-attribute/auxiliary/lint-stability.rs index de4058887cf..b9019329c22 100644 --- a/src/test/ui/stability-attribute/auxiliary/lint-stability.rs +++ b/src/test/ui/stability-attribute/auxiliary/lint-stability.rs @@ -5,21 +5,21 @@ #![stable(feature = "lint_stability", since = "1.0.0")] #[stable(feature = "stable_test_feature", since = "1.0.0")] -#[rustc_deprecated(since = "1.0.0", reason = "text")] +#[rustc_deprecated(since = "1.0.0", note = "text")] pub fn deprecated() {} #[stable(feature = "stable_test_feature", since = "1.0.0")] -#[rustc_deprecated(since = "1.0.0", reason = "text")] +#[rustc_deprecated(since = "1.0.0", note = "text")] pub fn deprecated_text() {} #[stable(feature = "stable_test_feature", since = "1.0.0")] -#[rustc_deprecated(since = "99.99.99", reason = "text")] +#[rustc_deprecated(since = "99.99.99", note = "text")] pub fn deprecated_future() {} #[unstable(feature = "unstable_test_feature", issue = "none")] -#[rustc_deprecated(since = "1.0.0", reason = "text")] +#[rustc_deprecated(since = "1.0.0", note = "text")] pub fn deprecated_unstable() {} #[unstable(feature = "unstable_test_feature", issue = "none")] -#[rustc_deprecated(since = "1.0.0", reason = "text")] +#[rustc_deprecated(since = "1.0.0", note = "text")] pub fn deprecated_unstable_text() {} #[unstable(feature = "unstable_test_feature", issue = "none")] @@ -37,17 +37,17 @@ pub struct MethodTester; impl MethodTester { #[stable(feature = "stable_test_feature", since = "1.0.0")] - #[rustc_deprecated(since = "1.0.0", reason = "text")] + #[rustc_deprecated(since = "1.0.0", note = "text")] pub fn method_deprecated(&self) {} #[stable(feature = "stable_test_feature", since = "1.0.0")] - #[rustc_deprecated(since = "1.0.0", reason = "text")] + #[rustc_deprecated(since = "1.0.0", note = "text")] pub fn method_deprecated_text(&self) {} #[unstable(feature = "unstable_test_feature", issue = "none")] - #[rustc_deprecated(since = "1.0.0", reason = "text")] + #[rustc_deprecated(since = "1.0.0", note = "text")] pub fn method_deprecated_unstable(&self) {} #[unstable(feature = "unstable_test_feature", issue = "none")] - #[rustc_deprecated(since = "1.0.0", reason = "text")] + #[rustc_deprecated(since = "1.0.0", note = "text")] pub fn method_deprecated_unstable_text(&self) {} #[unstable(feature = "unstable_test_feature", issue = "none")] @@ -64,17 +64,17 @@ impl MethodTester { #[stable(feature = "stable_test_feature", since = "1.0.0")] pub trait Trait { #[stable(feature = "stable_test_feature", since = "1.0.0")] - #[rustc_deprecated(since = "1.0.0", reason = "text")] + #[rustc_deprecated(since = "1.0.0", note = "text")] fn trait_deprecated(&self) {} #[stable(feature = "stable_test_feature", since = "1.0.0")] - #[rustc_deprecated(since = "1.0.0", reason = "text")] + #[rustc_deprecated(since = "1.0.0", note = "text")] fn trait_deprecated_text(&self) {} #[unstable(feature = "unstable_test_feature", issue = "none")] - #[rustc_deprecated(since = "1.0.0", reason = "text")] + #[rustc_deprecated(since = "1.0.0", note = "text")] fn trait_deprecated_unstable(&self) {} #[unstable(feature = "unstable_test_feature", issue = "none")] - #[rustc_deprecated(since = "1.0.0", reason = "text")] + #[rustc_deprecated(since = "1.0.0", note = "text")] fn trait_deprecated_unstable_text(&self) {} #[unstable(feature = "unstable_test_feature", issue = "none")] @@ -93,7 +93,7 @@ pub trait TraitWithAssociatedTypes { #[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")] + #[rustc_deprecated(since = "1.0.0", note = "text")] type TypeDeprecated = u8; } @@ -104,18 +104,18 @@ impl Trait for MethodTester {} pub trait UnstableTrait { fn dummy(&self) { } } #[stable(feature = "stable_test_feature", since = "1.0.0")] -#[rustc_deprecated(since = "1.0.0", reason = "text")] +#[rustc_deprecated(since = "1.0.0", note = "text")] pub trait DeprecatedTrait { #[stable(feature = "stable_test_feature", since = "1.0.0")] fn dummy(&self) { } } #[stable(feature = "stable_test_feature", since = "1.0.0")] -#[rustc_deprecated(since = "1.0.0", reason = "text")] +#[rustc_deprecated(since = "1.0.0", note = "text")] pub struct DeprecatedStruct { #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize } #[unstable(feature = "unstable_test_feature", issue = "none")] -#[rustc_deprecated(since = "1.0.0", reason = "text")] +#[rustc_deprecated(since = "1.0.0", note = "text")] pub struct DeprecatedUnstableStruct { #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize } @@ -133,10 +133,10 @@ pub enum UnstableEnum {} pub enum StableEnum {} #[stable(feature = "stable_test_feature", since = "1.0.0")] -#[rustc_deprecated(since = "1.0.0", reason = "text")] +#[rustc_deprecated(since = "1.0.0", note = "text")] pub struct DeprecatedUnitStruct; #[unstable(feature = "unstable_test_feature", issue = "none")] -#[rustc_deprecated(since = "1.0.0", reason = "text")] +#[rustc_deprecated(since = "1.0.0", note = "text")] pub struct DeprecatedUnstableUnitStruct; #[unstable(feature = "unstable_test_feature", issue = "none")] pub struct UnstableUnitStruct; @@ -146,10 +146,10 @@ pub struct StableUnitStruct; #[stable(feature = "stable_test_feature", since = "1.0.0")] pub enum Enum { #[stable(feature = "stable_test_feature", since = "1.0.0")] - #[rustc_deprecated(since = "1.0.0", reason = "text")] + #[rustc_deprecated(since = "1.0.0", note = "text")] DeprecatedVariant, #[unstable(feature = "unstable_test_feature", issue = "none")] - #[rustc_deprecated(since = "1.0.0", reason = "text")] + #[rustc_deprecated(since = "1.0.0", note = "text")] DeprecatedUnstableVariant, #[unstable(feature = "unstable_test_feature", issue = "none")] UnstableVariant, @@ -159,10 +159,10 @@ pub enum Enum { } #[stable(feature = "stable_test_feature", since = "1.0.0")] -#[rustc_deprecated(since = "1.0.0", reason = "text")] +#[rustc_deprecated(since = "1.0.0", note = "text")] pub struct DeprecatedTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize); #[unstable(feature = "unstable_test_feature", issue = "none")] -#[rustc_deprecated(since = "1.0.0", reason = "text")] +#[rustc_deprecated(since = "1.0.0", note = "text")] pub struct DeprecatedUnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize); #[unstable(feature = "unstable_test_feature", issue = "none")] pub struct UnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize); diff --git a/src/test/ui/stability-attribute/auxiliary/unstable_generic_param.rs b/src/test/ui/stability-attribute/auxiliary/unstable_generic_param.rs index 231ab966558..20dceb1ec12 100644 --- a/src/test/ui/stability-attribute/auxiliary/unstable_generic_param.rs +++ b/src/test/ui/stability-attribute/auxiliary/unstable_generic_param.rs @@ -40,14 +40,14 @@ pub struct Struct3<A = isize, #[unstable(feature = "unstable_default", issue = " pub field2: B, } -#[rustc_deprecated(since = "1.1.0", reason = "test")] +#[rustc_deprecated(since = "1.1.0", note = "test")] #[stable(feature = "stable_test_feature", since = "1.0.0")] pub struct Struct4<A = usize> { #[stable(feature = "stable_test_feature", since = "1.0.0")] pub field: A, } -#[rustc_deprecated(since = "1.1.0", reason = "test")] +#[rustc_deprecated(since = "1.1.0", note = "test")] #[stable(feature = "stable_test_feature", since = "1.0.0")] pub struct Struct5<#[unstable(feature = "unstable_default", issue = "none")] A = usize> { #[stable(feature = "stable_test_feature", since = "1.0.0")] @@ -99,7 +99,7 @@ pub enum Enum3<T = isize, #[unstable(feature = "unstable_default", issue = "none Err(#[stable(feature = "stable_test_feature", since = "1.0.0")] E), } -#[rustc_deprecated(since = "1.1.0", reason = "test")] +#[rustc_deprecated(since = "1.1.0", note = "test")] #[stable(feature = "stable_test_feature", since = "1.0.0")] pub enum Enum4<T = usize> { #[stable(feature = "stable_test_feature", since = "1.0.0")] @@ -108,7 +108,7 @@ pub enum Enum4<T = usize> { None, } -#[rustc_deprecated(since = "1.1.0", reason = "test")] +#[rustc_deprecated(since = "1.1.0", note = "test")] #[stable(feature = "stable_test_feature", since = "1.0.0")] pub enum Enum5<#[unstable(feature = "unstable_default", issue = "none")] T = usize> { #[stable(feature = "stable_test_feature", since = "1.0.0")] @@ -152,11 +152,11 @@ pub type Alias2<T = usize> = Option<T>; pub type Alias3<T = isize, #[unstable(feature = "unstable_default", issue = "none")] E = usize> = Result<T, E>; -#[rustc_deprecated(since = "1.1.0", reason = "test")] +#[rustc_deprecated(since = "1.1.0", note = "test")] #[stable(feature = "stable_test_feature", since = "1.0.0")] pub type Alias4<T = usize> = Option<T>; -#[rustc_deprecated(since = "1.1.0", reason = "test")] +#[rustc_deprecated(since = "1.1.0", note = "test")] #[stable(feature = "stable_test_feature", since = "1.0.0")] pub type Alias5<#[unstable(feature = "unstable_default", issue = "none")] T = usize> = Option<T>; diff --git a/src/test/ui/stability-attribute/stability-attribute-sanity-4.stderr b/src/test/ui/stability-attribute/stability-attribute-sanity-4.stderr index 651f293ff51..8e51215b1e6 100644 --- a/src/test/ui/stability-attribute/stability-attribute-sanity-4.stderr +++ b/src/test/ui/stability-attribute/stability-attribute-sanity-4.stderr @@ -26,13 +26,13 @@ error: malformed `rustc_deprecated` attribute input --> $DIR/stability-attribute-sanity-4.rs:21:5 | LL | #[rustc_deprecated] - | ^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_deprecated(since = "version", reason = "...")]` + | ^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_deprecated(since = "version", note = "...")]` error: malformed `rustc_deprecated` attribute input --> $DIR/stability-attribute-sanity-4.rs:26:5 | LL | #[rustc_deprecated = "a"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_deprecated(since = "version", reason = "...")]` + | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_deprecated(since = "version", note = "...")]` error[E0542]: missing 'since' --> $DIR/stability-attribute-sanity-4.rs:21:5 diff --git a/src/test/ui/stability-attribute/stability-attribute-sanity.rs b/src/test/ui/stability-attribute/stability-attribute-sanity.rs index fe8079dbc37..44874dd8cb0 100644 --- a/src/test/ui/stability-attribute/stability-attribute-sanity.rs +++ b/src/test/ui/stability-attribute/stability-attribute-sanity.rs @@ -37,11 +37,11 @@ mod missing_version { fn f1() { } #[stable(feature = "a", since = "b")] - #[rustc_deprecated(reason = "a")] //~ ERROR missing 'since' [E0542] + #[rustc_deprecated(note = "a")] //~ ERROR missing 'since' [E0542] fn f2() { } #[stable(feature = "a", since = "b")] - #[rustc_deprecated(since = "a")] //~ ERROR missing 'reason' [E0543] + #[rustc_deprecated(since = "a")] //~ ERROR missing 'note' [E0543] fn f3() { } } @@ -58,18 +58,18 @@ fn multiple2() { } fn multiple3() { } #[stable(feature = "a", since = "b")] //~ ERROR invalid stability version found -#[rustc_deprecated(since = "b", reason = "text")] -#[rustc_deprecated(since = "b", reason = "text")] //~ ERROR multiple deprecated attributes +#[rustc_deprecated(since = "b", note = "text")] +#[rustc_deprecated(since = "b", note = "text")] //~ ERROR multiple deprecated attributes #[rustc_const_unstable(feature = "c", issue = "none")] #[rustc_const_unstable(feature = "d", issue = "none")] //~ ERROR multiple stability levels pub const fn multiple4() { } #[stable(feature = "a", since = "1.0.0")] //~ ERROR invalid deprecation version found //~^ ERROR feature `a` is declared stable since 1.0.0 -#[rustc_deprecated(since = "invalid", reason = "text")] +#[rustc_deprecated(since = "invalid", note = "text")] fn invalid_deprecation_version() {} -#[rustc_deprecated(since = "a", reason = "text")] +#[rustc_deprecated(since = "a", note = "text")] fn deprecated_without_unstable_or_stable() { } //~^^ ERROR rustc_deprecated attribute must be paired with either stable or unstable attribute diff --git a/src/test/ui/stability-attribute/stability-attribute-sanity.stderr b/src/test/ui/stability-attribute/stability-attribute-sanity.stderr index b4e8fc78815..9b2cb2550ca 100644 --- a/src/test/ui/stability-attribute/stability-attribute-sanity.stderr +++ b/src/test/ui/stability-attribute/stability-attribute-sanity.stderr @@ -55,10 +55,10 @@ LL | #[stable(feature = "a")] error[E0542]: missing 'since' --> $DIR/stability-attribute-sanity.rs:40:5 | -LL | #[rustc_deprecated(reason = "a")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_deprecated(note = "a")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0543]: missing 'reason' +error[E0543]: missing 'note' --> $DIR/stability-attribute-sanity.rs:44:5 | LL | #[rustc_deprecated(since = "a")] @@ -85,10 +85,10 @@ LL | #[stable(feature = "a", since = "b")] error[E0550]: multiple deprecated attributes --> $DIR/stability-attribute-sanity.rs:62:1 | -LL | #[rustc_deprecated(since = "b", reason = "text")] - | ------------------------------------------------- first deprecation attribute -LL | #[rustc_deprecated(since = "b", reason = "text")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ repeated deprecation attribute +LL | #[rustc_deprecated(since = "b", note = "text")] + | ----------------------------------------------- first deprecation attribute +LL | #[rustc_deprecated(since = "b", note = "text")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ repeated deprecation attribute error[E0544]: multiple stability levels --> $DIR/stability-attribute-sanity.rs:64:1 @@ -117,8 +117,8 @@ LL | fn invalid_deprecation_version() {} error[E0549]: rustc_deprecated attribute must be paired with either stable or unstable attribute --> $DIR/stability-attribute-sanity.rs:72:1 | -LL | #[rustc_deprecated(since = "a", reason = "text")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[rustc_deprecated(since = "a", note = "text")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0711]: feature `a` is declared stable since 1.0.0, but was previously declared stable since b --> $DIR/stability-attribute-sanity.rs:67:1 |
