Rollup merge of #102351 - Rageking8:improve-E0585, r=wesleywiser
Improve E0585 help
This commit is contained in:
commit
19e84b91e5
19 changed files with 22 additions and 22 deletions
|
@ -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_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
|
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
|
.suggestion = missing comma here
|
||||||
|
|
||||||
parser_const_let_mutually_exclusive = `const` and `let` are mutually exclusive
|
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")
|
.span_label(self.token.span, "this doc comment doesn't document anything")
|
||||||
.help(
|
.help(
|
||||||
"doc comments must come before what they document, maybe a \
|
"doc comments must come before what they document, if a comment was \
|
||||||
comment was intended with `//`?",
|
intended use `//`",
|
||||||
)
|
)
|
||||||
.emit();
|
.emit();
|
||||||
self.bump();
|
self.bump();
|
||||||
|
|
|
@ -4,7 +4,7 @@ error[E0585]: found a documentation comment that doesn't document anything
|
||||||
LL | /// Hello! I'm useless...
|
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
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
struct X {
|
struct X {
|
||||||
a: u8 /** document a */,
|
a: u8 /** document a */,
|
||||||
//~^ ERROR found a documentation comment that doesn't document anything
|
//~^ 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 {
|
struct Y {
|
||||||
a: u8 /// document a
|
a: u8 /// document a
|
||||||
//~^ ERROR found a documentation comment that doesn't document anything
|
//~^ 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() {
|
fn main() {
|
||||||
|
|
|
@ -4,7 +4,7 @@ error[E0585]: found a documentation comment that doesn't document anything
|
||||||
LL | a: u8 /** document a */,
|
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
|
error[E0585]: found a documentation comment that doesn't document anything
|
||||||
--> $DIR/doc-after-struct-field.rs:8:11
|
--> $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
|
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
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ error[E0584]: found a documentation comment that doesn't document anything
|
||||||
LL | /// hi
|
LL | /// hi
|
||||||
| ^^^^^^ this doc comment doesn't document anything
|
| ^^^^^^ 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
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
fn main() {
|
fn main() {
|
||||||
/// document
|
/// document
|
||||||
//~^ ERROR found a documentation comment that doesn't document anything
|
//~^ 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
|
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
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("Hi"); /// hi
|
println!("Hi"); /// hi
|
||||||
//~^ ERROR found a documentation comment that doesn't document anything
|
//~^ 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
|
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
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
fn main() {
|
fn main() {
|
||||||
/// hi
|
/// hi
|
||||||
//~^ ERROR found a documentation comment that doesn't document anything
|
//~^ 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
|
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
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ struct X {
|
||||||
a: u8,
|
a: u8,
|
||||||
/// document
|
/// document
|
||||||
//~^ ERROR found a documentation comment that doesn't document anything
|
//~^ 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() {
|
fn main() {
|
||||||
|
|
|
@ -7,7 +7,7 @@ LL | a: u8,
|
||||||
LL | /// document
|
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
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
struct X {
|
struct X {
|
||||||
a: u8 /// document
|
a: u8 /// document
|
||||||
//~^ ERROR found a documentation comment that doesn't document anything
|
//~^ 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() {
|
fn main() {
|
||||||
|
|
|
@ -4,7 +4,7 @@ error[E0585]: found a documentation comment that doesn't document anything
|
||||||
LL | a: u8 /// document
|
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
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ error[E0584]: found a documentation comment that doesn't document anything
|
||||||
LL | /// empty doc
|
LL | /// empty doc
|
||||||
| ^^^^^^^^^^^^^ this doc comment doesn't document anything
|
| ^^^^^^^^^^^^^ 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
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ error[E0585]: found a documentation comment that doesn't document anything
|
||||||
LL | /// comment
|
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
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ LL | x: u8
|
||||||
LL | /// The ID of the parent core
|
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
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue