Rollup merge of #68670 - euclio:invalid-issue, r=estebank

clarify "incorrect issue" error

Changes the message to be more precise, shrinks the span and adds a label specifying why the `issue` field is incorrect.
This commit is contained in:
Dylan DPC
2020-01-31 01:21:30 +01:00
committed by GitHub
5 changed files with 47 additions and 30 deletions

View File

@@ -9,5 +9,5 @@ fn unstable_issue_0() {}
#[unstable(feature = "unstable_test_feature", issue = "none")]
fn unstable_issue_none() {}
#[unstable(feature = "unstable_test_feature", issue = "something")] //~ ERROR incorrect 'issue'
fn unstable_issue_not_allowed() {}
#[unstable(feature = "unstable_test_feature", issue = "something")]
fn unstable_issue_not_allowed() {} //~^ ERROR `issue` must be a numeric string or "none"

View File

@@ -1,8 +1,10 @@
error[E0545]: incorrect 'issue'
--> $DIR/unstable-attribute-allow-issue-0.rs:12:1
error[E0545]: `issue` must be a numeric string or "none"
--> $DIR/unstable-attribute-allow-issue-0.rs:12:47
|
LL | #[unstable(feature = "unstable_test_feature", issue = "something")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^-----------
| |
| invalid digit found in string
error: aborting due to previous error

View File

@@ -10,7 +10,7 @@ fn f1() { }
#[stable(feature = "a", sinse = "1.0.0")] //~ ERROR unknown meta item 'sinse'
fn f2() { }
#[unstable(feature = "a", issue = "no")] //~ ERROR incorrect 'issue'
#[unstable(feature = "a", issue = "no")] //~ ERROR `issue` must be a numeric string or "none"
fn f3() { }
fn main() { }

View File

@@ -10,11 +10,13 @@ error[E0541]: unknown meta item 'sinse'
LL | #[stable(feature = "a", sinse = "1.0.0")]
| ^^^^^^^^^^^^^^^ expected one of `since`, `note`
error[E0545]: incorrect 'issue'
--> $DIR/stability-attribute-sanity-2.rs:13:1
error[E0545]: `issue` must be a numeric string or "none"
--> $DIR/stability-attribute-sanity-2.rs:13:27
|
LL | #[unstable(feature = "a", issue = "no")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^----
| |
| invalid digit found in string
error: aborting due to 3 previous errors