Skip to content

Commit 02a8505

Browse files
authored
Rollup merge of #64812 - GuillaumeGomez:add-test-for-e0543, r=Centril
Add test for E0543
2 parents 0717483 + 8220252 commit 02a8505

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

Diff for: src/test/ui/stability-attribute/stability-attribute-sanity.rs

+4
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ mod missing_version {
3939
#[stable(feature = "a", since = "b")]
4040
#[rustc_deprecated(reason = "a")] //~ ERROR missing 'since' [E0542]
4141
fn f2() { }
42+
43+
#[stable(feature = "a", since = "b")]
44+
#[rustc_deprecated(since = "a")] //~ ERROR missing 'reason' [E0543]
45+
fn f3() { }
4246
}
4347

4448
#[unstable(feature = "b", issue = "0")]

Diff for: src/test/ui/stability-attribute/stability-attribute-sanity.stderr

+14-8
Original file line numberDiff line numberDiff line change
@@ -58,48 +58,54 @@ error[E0542]: missing 'since'
5858
LL | #[rustc_deprecated(reason = "a")]
5959
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6060

61+
error[E0543]: missing 'reason'
62+
--> $DIR/stability-attribute-sanity.rs:44:5
63+
|
64+
LL | #[rustc_deprecated(since = "a")]
65+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66+
6167
error[E0544]: multiple stability levels
62-
--> $DIR/stability-attribute-sanity.rs:45:1
68+
--> $DIR/stability-attribute-sanity.rs:49:1
6369
|
6470
LL | #[stable(feature = "a", since = "b")]
6571
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6672

6773
error[E0544]: multiple stability levels
68-
--> $DIR/stability-attribute-sanity.rs:49:1
74+
--> $DIR/stability-attribute-sanity.rs:53:1
6975
|
7076
LL | #[unstable(feature = "b", issue = "0")]
7177
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7278

7379
error[E0544]: multiple stability levels
74-
--> $DIR/stability-attribute-sanity.rs:53:1
80+
--> $DIR/stability-attribute-sanity.rs:57:1
7581
|
7682
LL | #[stable(feature = "a", since = "b")]
7783
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7884

7985
error[E0540]: multiple rustc_deprecated attributes
80-
--> $DIR/stability-attribute-sanity.rs:61:1
86+
--> $DIR/stability-attribute-sanity.rs:65:1
8187
|
8288
LL | pub const fn multiple4() { }
8389
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8490

8591
error[E0553]: multiple rustc_const_unstable attributes
86-
--> $DIR/stability-attribute-sanity.rs:61:1
92+
--> $DIR/stability-attribute-sanity.rs:65:1
8793
|
8894
LL | pub const fn multiple4() { }
8995
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9096

9197
error: Invalid stability or deprecation version found
92-
--> $DIR/stability-attribute-sanity.rs:61:1
98+
--> $DIR/stability-attribute-sanity.rs:65:1
9399
|
94100
LL | pub const fn multiple4() { }
95101
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
96102

97103
error[E0549]: rustc_deprecated attribute must be paired with either stable or unstable attribute
98-
--> $DIR/stability-attribute-sanity.rs:66:1
104+
--> $DIR/stability-attribute-sanity.rs:70:1
99105
|
100106
LL | fn deprecated_without_unstable_or_stable() { }
101107
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
102108

103-
error: aborting due to 17 previous errors
109+
error: aborting due to 18 previous errors
104110

105111
For more information about this error, try `rustc --explain E0541`.

0 commit comments

Comments
 (0)