diff options
| author | David Tolnay <dtolnay@gmail.com> | 2023-10-26 10:14:29 -0700 |
|---|---|---|
| committer | David Tolnay <dtolnay@gmail.com> | 2023-10-29 22:42:32 -0700 |
| commit | 2fe7d17bd9aabe3948b8693c2a3d4841ce9fbd14 (patch) | |
| tree | c8006b654e380b47fdea85fea88f84cb3e9b8d37 /tests | |
| parent | 5c7cf837395db7221bd1061eee230fd27f81e6ad (diff) | |
| download | rust-2fe7d17bd9aabe3948b8693c2a3d4841ce9fbd14.tar.gz rust-2fe7d17bd9aabe3948b8693c2a3d4841ce9fbd14.zip | |
Store version of `deprecated` attribute in structured form
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/stability-attribute/stability-attribute-sanity.rs | 5 | ||||
| -rw-r--r-- | tests/ui/stability-attribute/stability-attribute-sanity.stderr | 13 |
2 files changed, 7 insertions, 11 deletions
diff --git a/tests/ui/stability-attribute/stability-attribute-sanity.rs b/tests/ui/stability-attribute/stability-attribute-sanity.rs index 7030bcd3aba..7857a0603bd 100644 --- a/tests/ui/stability-attribute/stability-attribute-sanity.rs +++ b/tests/ui/stability-attribute/stability-attribute-sanity.rs @@ -64,9 +64,8 @@ fn multiple3() { } #[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 -#[deprecated(since = "invalid", note = "text")] +#[stable(feature = "a", since = "1.0.0")] //~ ERROR feature `a` is declared stable since 1.0.0 +#[deprecated(since = "invalid", note = "text")] //~ ERROR 'since' must be a Rust version number, such as "1.31.0" fn invalid_deprecation_version() {} #[deprecated(since = "5.5.5", note = "text")] diff --git a/tests/ui/stability-attribute/stability-attribute-sanity.stderr b/tests/ui/stability-attribute/stability-attribute-sanity.stderr index 27cd451f989..c614fc2b9f7 100644 --- a/tests/ui/stability-attribute/stability-attribute-sanity.stderr +++ b/tests/ui/stability-attribute/stability-attribute-sanity.stderr @@ -106,17 +106,14 @@ error[E0544]: multiple stability levels LL | #[rustc_const_unstable(feature = "d", issue = "none")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: invalid deprecation version found - --> $DIR/stability-attribute-sanity.rs:67:1 +error: 'since' must be a Rust version number, such as "1.31.0" + --> $DIR/stability-attribute-sanity.rs:68:1 | -LL | #[stable(feature = "a", since = "1.0.0")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid deprecation version -... -LL | fn invalid_deprecation_version() {} - | ----------------------------------- the stability attribute annotates this item +LL | #[deprecated(since = "invalid", note = "text")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0549]: deprecated attribute must be paired with either stable or unstable attribute - --> $DIR/stability-attribute-sanity.rs:72:1 + --> $DIR/stability-attribute-sanity.rs:71:1 | LL | #[deprecated(since = "5.5.5", note = "text")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
