Skip to content

Commit

Permalink
Rollup merge of #64812 - GuillaumeGomez:add-test-for-e0543, r=Centril
Browse files Browse the repository at this point in the history
Add test for E0543
  • Loading branch information
Centril committed Sep 26, 2019
2 parents 0717483 + 8220252 commit 02a8505
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
4 changes: 4 additions & 0 deletions src/test/ui/stability-attribute/stability-attribute-sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
22 changes: 14 additions & 8 deletions src/test/ui/stability-attribute/stability-attribute-sanity.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

0 comments on commit 02a8505

Please sign in to comment.