attr: fix expected meta-item for #[stable]

When an unexpected meta item is provided to `#[stable]`, the diagnostic
lists "since" and "note" as expected meta-items, however the surrounding
code actually expects "feature" and "since".

Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
David Wood 2022-07-13 10:36:12 +01:00
parent 6f0b8f1a4b
commit a1d5af24ec
3 changed files with 3 additions and 3 deletions

View File

@ -404,7 +404,7 @@ where
meta.span(),
AttrError::UnknownMetaItem(
pprust::path_to_string(&mi.path),
&["since", "note"],
&["feature", "since"],
),
);
continue 'outer;

View File

@ -8,7 +8,7 @@ error[E0541]: unknown meta item 'sinse'
--> $DIR/stability-attribute-sanity-2.rs:10:25
|
LL | #[stable(feature = "a", sinse = "1.0.0")]
| ^^^^^^^^^^^^^^^ expected one of `since`, `note`
| ^^^^^^^^^^^^^^^ expected one of `feature`, `since`
error[E0545]: `issue` must be a non-zero numeric string or "none"
--> $DIR/stability-attribute-sanity-2.rs:13:27

View File

@ -14,7 +14,7 @@ error[E0541]: unknown meta item 'reason'
--> $DIR/stability-attribute-sanity.rs:8:42
|
LL | #[stable(feature = "a", since = "b", reason)]
| ^^^^^^ expected one of `since`, `note`
| ^^^^^^ expected one of `feature`, `since`
error[E0539]: incorrect meta item
--> $DIR/stability-attribute-sanity.rs:11:29