Rollup merge of #64812 - GuillaumeGomez:add-test-for-e0543, r=Centril

Add test for E0543
This commit is contained in:
Mazdak Farrokhzad 2019-09-26 17:55:18 +02:00 committed by GitHub
commit 02a8505f86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 8 deletions

View File

@ -39,6 +39,10 @@ mod missing_version {
#[stable(feature = "a", since = "b")]
#[rustc_deprecated(reason = "a")] //~ ERROR missing 'since' [E0542]
fn f2() { }
#[stable(feature = "a", since = "b")]
#[rustc_deprecated(since = "a")] //~ ERROR missing 'reason' [E0543]
fn f3() { }
}
#[unstable(feature = "b", issue = "0")]

View File

@ -58,48 +58,54 @@ error[E0542]: missing 'since'
LL | #[rustc_deprecated(reason = "a")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0543]: missing 'reason'
--> $DIR/stability-attribute-sanity.rs:44:5
|
LL | #[rustc_deprecated(since = "a")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0544]: multiple stability levels
--> $DIR/stability-attribute-sanity.rs:45:1
--> $DIR/stability-attribute-sanity.rs:49:1
|
LL | #[stable(feature = "a", since = "b")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0544]: multiple stability levels
--> $DIR/stability-attribute-sanity.rs:49:1
--> $DIR/stability-attribute-sanity.rs:53:1
|
LL | #[unstable(feature = "b", issue = "0")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0544]: multiple stability levels
--> $DIR/stability-attribute-sanity.rs:53:1
--> $DIR/stability-attribute-sanity.rs:57:1
|
LL | #[stable(feature = "a", since = "b")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0540]: multiple rustc_deprecated attributes
--> $DIR/stability-attribute-sanity.rs:61:1
--> $DIR/stability-attribute-sanity.rs:65:1
|
LL | pub const fn multiple4() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0553]: multiple rustc_const_unstable attributes
--> $DIR/stability-attribute-sanity.rs:61:1
--> $DIR/stability-attribute-sanity.rs:65:1
|
LL | pub const fn multiple4() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: Invalid stability or deprecation version found
--> $DIR/stability-attribute-sanity.rs:61:1
--> $DIR/stability-attribute-sanity.rs:65:1
|
LL | pub const fn multiple4() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0549]: rustc_deprecated attribute must be paired with either stable or unstable attribute
--> $DIR/stability-attribute-sanity.rs:66:1
--> $DIR/stability-attribute-sanity.rs:70:1
|
LL | fn deprecated_without_unstable_or_stable() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 17 previous errors
error: aborting due to 18 previous errors
For more information about this error, try `rustc --explain E0541`.