Auto merge of #68685 - Dylan-DPC:rollup-rkbo05z, r=Dylan-DPC
Rollup of 6 pull requests Successful merges: - #68588 (check_unsafety: more code reuse) - #68638 (Add missing links for cmp traits) - #68660 (Fix typo.) - #68669 (suggest adding space in accidental doc comments) - #68670 (clarify "incorrect issue" error) - #68680 (Add `#![doc(html_playground_url = ...)]` to alloc crate) Failed merges: r? @ghost
This commit is contained in:
commit
266ecd6625
12 changed files with 188 additions and 93 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
20
src/test/ui/parser/doc-comment-in-stmt.rs
Normal file
20
src/test/ui/parser/doc-comment-in-stmt.rs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
fn foo() -> bool {
|
||||
false
|
||||
//!self.allow_ty_infer()
|
||||
//~^ ERROR found doc comment
|
||||
}
|
||||
|
||||
fn bar() -> bool {
|
||||
false
|
||||
/*! bar */ //~ ERROR found doc comment
|
||||
}
|
||||
|
||||
fn baz() -> i32 {
|
||||
1 /** baz */ //~ ERROR found doc comment
|
||||
}
|
||||
|
||||
fn quux() -> i32 {
|
||||
2 /*! quux */ //~ ERROR found doc comment
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
50
src/test/ui/parser/doc-comment-in-stmt.stderr
Normal file
50
src/test/ui/parser/doc-comment-in-stmt.stderr
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
error: expected one of `.`, `;`, `?`, `}`, or an operator, found doc comment `//!self.allow_ty_infer()`
|
||||
--> $DIR/doc-comment-in-stmt.rs:3:5
|
||||
|
|
||||
LL | false
|
||||
| - expected one of `.`, `;`, `?`, `}`, or an operator
|
||||
LL | //!self.allow_ty_infer()
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ unexpected token
|
||||
|
|
||||
help: add a space before `!` to use a regular comment
|
||||
|
|
||||
LL | // !self.allow_ty_infer()
|
||||
| ^^^^
|
||||
|
||||
error: expected one of `.`, `;`, `?`, `}`, or an operator, found doc comment `/*! bar */`
|
||||
--> $DIR/doc-comment-in-stmt.rs:9:5
|
||||
|
|
||||
LL | false
|
||||
| - expected one of `.`, `;`, `?`, `}`, or an operator
|
||||
LL | /*! bar */
|
||||
| ^^^^^^^^^^ unexpected token
|
||||
|
|
||||
help: add a space before `!` to use a regular comment
|
||||
|
|
||||
LL | /* ! bar */
|
||||
| ^^^^
|
||||
|
||||
error: expected one of `.`, `;`, `?`, `}`, or an operator, found doc comment `/** baz */`
|
||||
--> $DIR/doc-comment-in-stmt.rs:13:7
|
||||
|
|
||||
LL | 1 /** baz */
|
||||
| ^^^^^^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
|
||||
|
|
||||
help: add a space before `*` to use a regular comment
|
||||
|
|
||||
LL | 1 /* * baz */
|
||||
| ^^^^
|
||||
|
||||
error: expected one of `.`, `;`, `?`, `}`, or an operator, found doc comment `/*! quux */`
|
||||
--> $DIR/doc-comment-in-stmt.rs:17:7
|
||||
|
|
||||
LL | 2 /*! quux */
|
||||
| ^^^^^^^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
|
||||
|
|
||||
help: add a space before `!` to use a regular comment
|
||||
|
|
||||
LL | 2 /* ! quux */
|
||||
| ^^^^
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
|
@ -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() { }
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue