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:
parent
6f0b8f1a4b
commit
a1d5af24ec
3 changed files with 3 additions and 3 deletions
|
@ -404,7 +404,7 @@ where
|
||||||
meta.span(),
|
meta.span(),
|
||||||
AttrError::UnknownMetaItem(
|
AttrError::UnknownMetaItem(
|
||||||
pprust::path_to_string(&mi.path),
|
pprust::path_to_string(&mi.path),
|
||||||
&["since", "note"],
|
&["feature", "since"],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
continue 'outer;
|
continue 'outer;
|
||||||
|
|
|
@ -8,7 +8,7 @@ error[E0541]: unknown meta item 'sinse'
|
||||||
--> $DIR/stability-attribute-sanity-2.rs:10:25
|
--> $DIR/stability-attribute-sanity-2.rs:10:25
|
||||||
|
|
|
|
||||||
LL | #[stable(feature = "a", sinse = "1.0.0")]
|
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"
|
error[E0545]: `issue` must be a non-zero numeric string or "none"
|
||||||
--> $DIR/stability-attribute-sanity-2.rs:13:27
|
--> $DIR/stability-attribute-sanity-2.rs:13:27
|
||||||
|
|
|
@ -14,7 +14,7 @@ error[E0541]: unknown meta item 'reason'
|
||||||
--> $DIR/stability-attribute-sanity.rs:8:42
|
--> $DIR/stability-attribute-sanity.rs:8:42
|
||||||
|
|
|
|
||||||
LL | #[stable(feature = "a", since = "b", reason)]
|
LL | #[stable(feature = "a", since = "b", reason)]
|
||||||
| ^^^^^^ expected one of `since`, `note`
|
| ^^^^^^ expected one of `feature`, `since`
|
||||||
|
|
||||||
error[E0539]: incorrect meta item
|
error[E0539]: incorrect meta item
|
||||||
--> $DIR/stability-attribute-sanity.rs:11:29
|
--> $DIR/stability-attribute-sanity.rs:11:29
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue