Rollup merge of #102351 - Rageking8:improve-E0585, r=wesleywiser

Improve E0585 help
This commit is contained in:
Yuki Okushi 2022-09-29 11:42:04 +09:00 committed by GitHub
commit 19e84b91e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 22 additions and 22 deletions

View File

@ -245,7 +245,7 @@ parser_assignment_else_not_allowed = <assignment> ... else {"{"} ... {"}"} is no
parser_expected_statement_after_outer_attr = expected statement after outer attribute
parser_doc_comment_does_not_document_anything = found a documentation comment that doesn't document anything
.help = doc comments must come before what they document, maybe a comment was intended with `//`?
.help = doc comments must come before what they document, if a comment was intended use `//`
.suggestion = missing comma here
parser_const_let_mutually_exclusive = `const` and `let` are mutually exclusive

View File

@ -760,8 +760,8 @@ impl<'a> Parser<'a> {
)
.span_label(self.token.span, "this doc comment doesn't document anything")
.help(
"doc comments must come before what they document, maybe a \
comment was intended with `//`?",
"doc comments must come before what they document, if a comment was \
intended use `//`",
)
.emit();
self.bump();

View File

@ -4,7 +4,7 @@ error[E0585]: found a documentation comment that doesn't document anything
LL | /// Hello! I'm useless...
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
= help: doc comments must come before what they document, if a comment was intended use `//`
error: aborting due to previous error

View File

@ -1,13 +1,13 @@
struct X {
a: u8 /** document a */,
//~^ ERROR found a documentation comment that doesn't document anything
//~| HELP maybe a comment was intended
//~| HELP if a comment was intended use `//`
}
struct Y {
a: u8 /// document a
//~^ ERROR found a documentation comment that doesn't document anything
//~| HELP maybe a comment was intended
//~| HELP if a comment was intended use `//`
}
fn main() {

View File

@ -4,7 +4,7 @@ error[E0585]: found a documentation comment that doesn't document anything
LL | a: u8 /** document a */,
| ^^^^^^^^^^^^^^^^^
|
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
= help: doc comments must come before what they document, if a comment was intended use `//`
error[E0585]: found a documentation comment that doesn't document anything
--> $DIR/doc-after-struct-field.rs:8:11
@ -12,7 +12,7 @@ error[E0585]: found a documentation comment that doesn't document anything
LL | a: u8 /// document a
| ^^^^^^^^^^^^^^
|
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
= help: doc comments must come before what they document, if a comment was intended use `//`
error: aborting due to 2 previous errors

View File

@ -4,7 +4,7 @@ error[E0584]: found a documentation comment that doesn't document anything
LL | /// hi
| ^^^^^^ this doc comment doesn't document anything
|
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
= help: doc comments must come before what they document, if a comment was intended use `//`
error: aborting due to previous error

View File

@ -1,5 +1,5 @@
fn main() {
/// document
//~^ ERROR found a documentation comment that doesn't document anything
//~| HELP maybe a comment was intended
//~| HELP if a comment was intended use `//`
}

View File

@ -4,7 +4,7 @@ error[E0585]: found a documentation comment that doesn't document anything
LL | /// document
| ^^^^^^^^^^^^
|
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
= help: doc comments must come before what they document, if a comment was intended use `//`
error: aborting due to previous error

View File

@ -1,5 +1,5 @@
fn main() {
println!("Hi"); /// hi
//~^ ERROR found a documentation comment that doesn't document anything
//~| HELP maybe a comment was intended
//~| HELP if a comment was intended use `//`
}

View File

@ -4,7 +4,7 @@ error[E0585]: found a documentation comment that doesn't document anything
LL | println!("Hi"); /// hi
| ^^^^^^
|
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
= help: doc comments must come before what they document, if a comment was intended use `//`
error: aborting due to previous error

View File

@ -1,6 +1,6 @@
fn main() {
/// hi
//~^ ERROR found a documentation comment that doesn't document anything
//~| HELP maybe a comment was intended
//~| HELP if a comment was intended use `//`
;
}

View File

@ -4,7 +4,7 @@ error[E0585]: found a documentation comment that doesn't document anything
LL | /// hi
| ^^^^^^
|
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
= help: doc comments must come before what they document, if a comment was intended use `//`
error: aborting due to previous error

View File

@ -2,7 +2,7 @@ struct X {
a: u8,
/// document
//~^ ERROR found a documentation comment that doesn't document anything
//~| HELP maybe a comment was intended
//~| HELP if a comment was intended use `//`
}
fn main() {

View File

@ -7,7 +7,7 @@ LL | a: u8,
LL | /// document
| ^^^^^^^^^^^^
|
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
= help: doc comments must come before what they document, if a comment was intended use `//`
error: aborting due to previous error

View File

@ -1,7 +1,7 @@
struct X {
a: u8 /// document
//~^ ERROR found a documentation comment that doesn't document anything
//~| HELP maybe a comment was intended
//~| HELP if a comment was intended use `//`
}
fn main() {

View File

@ -4,7 +4,7 @@ error[E0585]: found a documentation comment that doesn't document anything
LL | a: u8 /// document
| ^^^^^^^^^^^^
|
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
= help: doc comments must come before what they document, if a comment was intended use `//`
error: aborting due to previous error

View File

@ -4,7 +4,7 @@ error[E0584]: found a documentation comment that doesn't document anything
LL | /// empty doc
| ^^^^^^^^^^^^^ this doc comment doesn't document anything
|
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
= help: doc comments must come before what they document, if a comment was intended use `//`
error: aborting due to previous error

View File

@ -4,7 +4,7 @@ error[E0585]: found a documentation comment that doesn't document anything
LL | /// comment
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
= help: doc comments must come before what they document, if a comment was intended use `//`
error: aborting due to previous error

View File

@ -8,7 +8,7 @@ LL | x: u8
LL | /// The ID of the parent core
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
= help: doc comments must come before what they document, if a comment was intended use `//`
error: aborting due to previous error