Rollup merge of #102351 - Rageking8:improve-E0585, r=wesleywiser
Improve E0585 help
This commit is contained in:
commit
19e84b91e5
@ -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
|
||||
|
@ -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();
|
||||
|
@ -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
|
||||
|
||||
|
@ -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() {
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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 `//`
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
@ -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 `//`
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
@ -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 `//`
|
||||
;
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
@ -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() {
|
||||
|
@ -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
|
||||
|
||||
|
@ -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() {
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user