Update `since` stability attributes in tests

This commit is contained in:
David Tolnay 2023-10-16 13:11:26 -07:00
parent 82ed3f5e8b
commit 6a02e20fb5
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
15 changed files with 79 additions and 69 deletions

View File

@ -1,21 +1,21 @@
#![stable(feature = "bar", since = "OLD 1.0")]
#![stable(feature = "bar", since = "3.3.3")]
#![crate_name = "foo"]
#![feature(staged_api)]
#[stable(feature = "bar", since = "OLD 1.0")]
#[stable(feature = "bar", since = "3.3.3")]
pub trait Bar {}
#[stable(feature = "baz", since = "OLD 1.0")]
#[stable(feature = "baz", since = "3.3.3")]
pub trait Baz {}
#[stable(feature = "baz", since = "OLD 1.0")]
#[stable(feature = "baz", since = "3.3.3")]
pub struct Foo;
// @has foo/trait.Bar.html '//div[@id="implementors-list"]//span[@class="since"]' 'NEW 2.0'
#[stable(feature = "foobar", since = "NEW 2.0")]
// @has foo/trait.Bar.html '//div[@id="implementors-list"]//span[@class="since"]' '4.4.4'
#[stable(feature = "foobar", since = "4.4.4")]
impl Bar for Foo {}
// @!has foo/trait.Baz.html '//div[@id="implementors-list"]//span[@class="since"]' 'OLD 1.0'
#[stable(feature = "foobaz", since = "OLD 1.0")]
// @!has foo/trait.Baz.html '//div[@id="implementors-list"]//span[@class="since"]' '3.3.3'
#[stable(feature = "foobaz", since = "3.3.3")]
impl Baz for Foo {}

View File

@ -1,7 +1,7 @@
#![feature(staged_api)]
#![stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "foo", since = "0")]
#[rustc_const_stable(feature = "foo", since = "3.3.3")]
//~^ ERROR macros cannot have const stability attributes
macro_rules! foo {
() => {};

View File

@ -1,8 +1,8 @@
error: macros cannot have const stability attributes
--> $DIR/const-stability-on-macro.rs:4:1
|
LL | #[rustc_const_stable(feature = "foo", since = "0")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid const stability attribute
LL | #[rustc_const_stable(feature = "foo", since = "3.3.3")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid const stability attribute
LL |
LL | macro_rules! foo {
| ---------------- const stability attribute affects this macro

View File

@ -4,12 +4,12 @@
// FIXME(const_generics_defaults): It seems like we aren't testing the right thing here,
// I would assume that we want the attributes to apply to the const parameter defaults
// themselves.
#![stable(feature = "const_default_test", since="none")]
#![stable(feature = "const_default_test", since = "3.3.3")]
#[unstable(feature = "const_default_stable", issue="none")]
#[unstable(feature = "const_default_stable", issue = "none")]
pub struct ConstDefaultUnstable<const N: usize = 3>;
#[stable(feature = "const_default_unstable", since="none")]
#[stable(feature = "const_default_unstable", since = "3.3.3")]
pub struct ConstDefaultStable<const N: usize = {
3
}>;

View File

@ -1,11 +1,11 @@
#![stable(feature = "a", since = "b")]
#![stable(feature = "a", since = "3.3.3")]
//~^ ERROR stability attributes may not be used outside of the standard library
mod inner_private_module {
// UnnameableTypeAlias isn't marked as reachable, so no stability annotation is required here
pub type UnnameableTypeAlias = u8;
}
#[stable(feature = "a", since = "b")]
#[stable(feature = "a", since = "3.3.3")]
//~^ ERROR stability attributes may not be used outside of the standard library
pub fn f() -> inner_private_module::UnnameableTypeAlias {
0

View File

@ -1,14 +1,14 @@
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/feature-gate-staged_api.rs:8:1
|
LL | #[stable(feature = "a", since = "b")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | #[stable(feature = "a", since = "3.3.3")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/feature-gate-staged_api.rs:1:1
|
LL | #![stable(feature = "a", since = "b")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | #![stable(feature = "a", since = "3.3.3")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors

View File

@ -1,14 +1,14 @@
// run-pass
#![feature(staged_api)]
#![stable(feature = "a", since = "b")]
#![stable(feature = "a", since = "3.3.3")]
mod inner_private_module {
// UnnameableTypeAlias isn't marked as reachable, so no stability annotation is required here
pub type UnnameableTypeAlias = u8;
}
#[stable(feature = "a", since = "b")]
#[stable(feature = "a", since = "3.3.3")]
pub fn f() -> inner_private_module::UnnameableTypeAlias {
0
}

View File

@ -8,7 +8,7 @@
#![feature(no_core, lang_items, intrinsics, staged_api, rustc_attrs)]
#![no_core]
#![crate_type = "lib"]
#![stable(feature = "intrinsics_for_test", since = "")]
#![stable(feature = "intrinsics_for_test", since = "3.3.3")]
#![allow(dead_code)]
// Test that the repr(C) attribute doesn't break compilation
@ -22,8 +22,8 @@ enum Foo {
}
extern "rust-intrinsic" {
#[stable(feature = "intrinsics_for_test", since = "")]
#[rustc_const_stable(feature = "intrinsics_for_test", since = "")]
#[stable(feature = "intrinsics_for_test", since = "3.3.3")]
#[rustc_const_stable(feature = "intrinsics_for_test", since = "3.3.3")]
#[rustc_safe_intrinsic]
fn size_of<T>() -> usize;
}

View File

@ -7,7 +7,7 @@
#![feature(staged_api)]
#![feature(const_trait_impl)]
#![stable(since = "1", feature = "foo")]
#![stable(feature = "foo", since = "3.3.3")]
#[const_trait]
trait Tr {

View File

@ -1,12 +1,12 @@
// check-pass
#![feature(staged_api)]
#![stable(feature = "test", since = "0")]
#![stable(feature = "test", since = "3.3.3")]
#[stable(feature = "test", since = "0")]
#[stable(feature = "test", since = "3.3.3")]
pub struct A<T>(pub T);
#[stable(feature = "test", since = "0")]
pub struct B<T>(#[stable(feature = "test", since = "0")] pub T);
#[stable(feature = "test", since = "3.3.3")]
pub struct B<T>(#[stable(feature = "test", since = "3.3.3")] pub T);
fn main() {
// Make sure the field is used to fill the stability cache

View File

@ -17,11 +17,11 @@ mod bogus_attribute_types_2 {
#[stable = "a"] //~ ERROR malformed `stable` attribute
fn f4() { }
#[stable(feature = "a", since = "b")]
#[stable(feature = "a", since = "3.3.3")]
#[deprecated] //~ ERROR missing 'since'
fn f5() { }
#[stable(feature = "a", since = "b")]
#[stable(feature = "a", since = "3.3.3")]
#[deprecated = "a"] //~ ERROR missing 'since'
fn f6() { }
}

View File

@ -5,19 +5,19 @@
#![stable(feature = "rust1", since = "1.0.0")]
mod bogus_attribute_types_1 {
#[stable(feature = "a", since = "b", reason)] //~ ERROR unknown meta item 'reason' [E0541]
#[stable(feature = "a", since = "4.4.4", reason)] //~ ERROR unknown meta item 'reason' [E0541]
fn f1() { }
#[stable(feature = "a", since)] //~ ERROR incorrect meta item [E0539]
fn f2() { }
#[stable(feature, since = "a")] //~ ERROR incorrect meta item [E0539]
#[stable(feature, since = "3.3.3")] //~ ERROR incorrect meta item [E0539]
fn f3() { }
#[stable(feature = "a", since(b))] //~ ERROR incorrect meta item [E0539]
fn f5() { }
#[stable(feature(b), since = "a")] //~ ERROR incorrect meta item [E0539]
#[stable(feature(b), since = "3.3.3")] //~ ERROR incorrect meta item [E0539]
fn f6() { }
}
@ -28,7 +28,7 @@ mod missing_feature_names {
#[unstable(feature = "b")] //~ ERROR missing 'issue' [E0547]
fn f2() { }
#[stable(since = "a")] //~ ERROR missing 'feature' [E0546]
#[stable(since = "3.3.3")] //~ ERROR missing 'feature' [E0546]
fn f3() { }
}
@ -36,33 +36,34 @@ mod missing_version {
#[stable(feature = "a")] //~ ERROR missing 'since' [E0542]
fn f1() { }
#[stable(feature = "a", since = "b")]
#[stable(feature = "a", since = "4.4.4")]
#[deprecated(note = "a")] //~ ERROR missing 'since' [E0542]
fn f2() { }
#[stable(feature = "a", since = "b")]
#[stable(feature = "a", since = "4.4.4")]
#[deprecated(since = "a")] //~ ERROR missing 'note' [E0543]
fn f3() { }
}
#[unstable(feature = "b", issue = "none")]
#[stable(feature = "a", since = "b")] //~ ERROR multiple stability levels [E0544]
#[stable(feature = "a", since = "4.4.4")] //~ ERROR multiple stability levels [E0544]
fn multiple1() { }
#[unstable(feature = "b", issue = "none")]
#[unstable(feature = "b", issue = "none")] //~ ERROR multiple stability levels [E0544]
fn multiple2() { }
#[stable(feature = "a", since = "b")]
#[stable(feature = "a", since = "b")] //~ ERROR multiple stability levels [E0544]
#[stable(feature = "a", since = "4.4.4")]
#[stable(feature = "a", since = "4.4.4")] //~ ERROR multiple stability levels [E0544]
fn multiple3() { }
#[stable(feature = "a", since = "b")] //~ ERROR invalid stability version found
#[stable(feature = "e", since = "b")] //~ ERROR 'since' must be a Rust version number, such as "1.31.0"
#[deprecated(since = "b", note = "text")]
#[deprecated(since = "b", note = "text")] //~ ERROR multiple `deprecated` attributes
//~^ ERROR deprecated attribute must be paired with either stable or unstable attribute
#[rustc_const_unstable(feature = "c", issue = "none")]
#[rustc_const_unstable(feature = "d", issue = "none")] //~ ERROR multiple stability levels
pub const fn multiple4() { }
pub const fn multiple4() { } //~ ERROR function has missing stability attribute
#[stable(feature = "a", since = "1.0.0")] //~ ERROR invalid deprecation version found
//~^ ERROR feature `a` is declared stable since 1.0.0

View File

@ -11,10 +11,10 @@ LL | #[deprecated(since = "b", note = "text")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0541]: unknown meta item 'reason'
--> $DIR/stability-attribute-sanity.rs:8:42
--> $DIR/stability-attribute-sanity.rs:8:46
|
LL | #[stable(feature = "a", since = "b", reason)]
| ^^^^^^ expected one of `feature`, `since`
LL | #[stable(feature = "a", since = "4.4.4", reason)]
| ^^^^^^ expected one of `feature`, `since`
error[E0539]: incorrect meta item
--> $DIR/stability-attribute-sanity.rs:11:29
@ -25,7 +25,7 @@ LL | #[stable(feature = "a", since)]
error[E0539]: incorrect meta item
--> $DIR/stability-attribute-sanity.rs:14:14
|
LL | #[stable(feature, since = "a")]
LL | #[stable(feature, since = "3.3.3")]
| ^^^^^^^
error[E0539]: incorrect meta item
@ -37,7 +37,7 @@ LL | #[stable(feature = "a", since(b))]
error[E0539]: incorrect meta item
--> $DIR/stability-attribute-sanity.rs:20:14
|
LL | #[stable(feature(b), since = "a")]
LL | #[stable(feature(b), since = "3.3.3")]
| ^^^^^^^^^^
error[E0546]: missing 'feature'
@ -55,8 +55,8 @@ LL | #[unstable(feature = "b")]
error[E0546]: missing 'feature'
--> $DIR/stability-attribute-sanity.rs:31:5
|
LL | #[stable(since = "a")]
| ^^^^^^^^^^^^^^^^^^^^^^
LL | #[stable(since = "3.3.3")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0542]: missing 'since'
--> $DIR/stability-attribute-sanity.rs:36:5
@ -79,8 +79,8 @@ LL | #[deprecated(since = "a")]
error[E0544]: multiple stability levels
--> $DIR/stability-attribute-sanity.rs:49:1
|
LL | #[stable(feature = "a", since = "b")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | #[stable(feature = "a", since = "4.4.4")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0544]: multiple stability levels
--> $DIR/stability-attribute-sanity.rs:53:1
@ -91,26 +91,29 @@ LL | #[unstable(feature = "b", issue = "none")]
error[E0544]: multiple stability levels
--> $DIR/stability-attribute-sanity.rs:57:1
|
LL | #[stable(feature = "a", since = "b")]
LL | #[stable(feature = "a", since = "4.4.4")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: 'since' must be a Rust version number, such as "1.31.0"
--> $DIR/stability-attribute-sanity.rs:60:1
|
LL | #[stable(feature = "e", since = "b")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0544]: multiple stability levels
--> $DIR/stability-attribute-sanity.rs:64:1
--> $DIR/stability-attribute-sanity.rs:65:1
|
LL | #[rustc_const_unstable(feature = "d", issue = "none")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: invalid stability version found
--> $DIR/stability-attribute-sanity.rs:60:1
error[E0549]: deprecated attribute must be paired with either stable or unstable attribute
--> $DIR/stability-attribute-sanity.rs:62:1
|
LL | #[stable(feature = "a", since = "b")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid stability version
...
LL | pub const fn multiple4() { }
| ---------------------------- the stability attribute annotates this item
LL | #[deprecated(since = "b", note = "text")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: invalid deprecation version found
--> $DIR/stability-attribute-sanity.rs:67:1
--> $DIR/stability-attribute-sanity.rs:68:1
|
LL | #[stable(feature = "a", since = "1.0.0")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid deprecation version
@ -119,18 +122,24 @@ LL | fn invalid_deprecation_version() {}
| ----------------------------------- the stability attribute annotates this item
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:73:1
|
LL | #[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
error: function has missing stability attribute
--> $DIR/stability-attribute-sanity.rs:66:1
|
LL | pub const fn multiple4() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0711]: feature `a` is declared stable since 1.0.0, but was previously declared stable since 4.4.4
--> $DIR/stability-attribute-sanity.rs:68:1
|
LL | #[stable(feature = "a", since = "1.0.0")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 20 previous errors
error: aborting due to 22 previous errors
Some errors have detailed explanations: E0539, E0541, E0542, E0543, E0544, E0546, E0547, E0549, E0711.
For more information about an error, try `rustc --explain E0539`.

View File

@ -1,13 +1,13 @@
#![feature(staged_api, never_type, rust_cold_cc)]
//~^ ERROR module has missing stability attribute
#[stable(feature = "a", since = "1")]
#[stable(feature = "a", since = "3.3.3")]
struct StableType;
#[unstable(feature = "b", issue = "none")]
struct UnstableType;
#[stable(feature = "c", since = "1")]
#[stable(feature = "c", since = "3.3.3")]
trait StableTrait {}
#[unstable(feature = "d", issue = "none")]

View File

@ -21,7 +21,7 @@ error: module has missing stability attribute
LL | / #![feature(staged_api, never_type, rust_cold_cc)]
LL | |
LL | |
LL | | #[stable(feature = "a", since = "1")]
LL | | #[stable(feature = "a", since = "3.3.3")]
... |
LL | |
LL | | fn main() {}