Skip to content

Commit 19e84b9

Browse files
authored
Rollup merge of #102351 - Rageking8:improve-E0585, r=wesleywiser
Improve E0585 help
2 parents 852a152 + 2ee2ffa commit 19e84b9

19 files changed

+22
-22
lines changed

compiler/rustc_error_messages/locales/en-US/parser.ftl

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

compiler/rustc_parse/src/parser/item.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -760,8 +760,8 @@ impl<'a> Parser<'a> {
760760
)
761761
.span_label(self.token.span, "this doc comment doesn't document anything")
762762
.help(
763-
"doc comments must come before what they document, maybe a \
764-
comment was intended with `//`?",
763+
"doc comments must come before what they document, if a comment was \
764+
intended use `//`",
765765
)
766766
.emit();
767767
self.bump();

src/test/ui/error-codes/E0585.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0585]: found a documentation comment that doesn't document anything
44
LL | /// Hello! I'm useless...
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
7+
= help: doc comments must come before what they document, if a comment was intended use `//`
88

99
error: aborting due to previous error
1010

src/test/ui/parser/doc-after-struct-field.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
struct X {
22
a: u8 /** document a */,
33
//~^ ERROR found a documentation comment that doesn't document anything
4-
//~| HELP maybe a comment was intended
4+
//~| HELP if a comment was intended use `//`
55
}
66

77
struct Y {
88
a: u8 /// document a
99
//~^ ERROR found a documentation comment that doesn't document anything
10-
//~| HELP maybe a comment was intended
10+
//~| HELP if a comment was intended use `//`
1111
}
1212

1313
fn main() {

src/test/ui/parser/doc-after-struct-field.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ error[E0585]: found a documentation comment that doesn't document anything
44
LL | a: u8 /** document a */,
55
| ^^^^^^^^^^^^^^^^^
66
|
7-
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
7+
= help: doc comments must come before what they document, if a comment was intended use `//`
88

99
error[E0585]: found a documentation comment that doesn't document anything
1010
--> $DIR/doc-after-struct-field.rs:8:11
1111
|
1212
LL | a: u8 /// document a
1313
| ^^^^^^^^^^^^^^
1414
|
15-
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
15+
= help: doc comments must come before what they document, if a comment was intended use `//`
1616

1717
error: aborting due to 2 previous errors
1818

src/test/ui/parser/doc-before-extern-rbrace.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0584]: found a documentation comment that doesn't document anything
44
LL | /// hi
55
| ^^^^^^ this doc comment doesn't document anything
66
|
7-
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
7+
= help: doc comments must come before what they document, if a comment was intended use `//`
88

99
error: aborting due to previous error
1010

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
fn main() {
22
/// document
33
//~^ ERROR found a documentation comment that doesn't document anything
4-
//~| HELP maybe a comment was intended
4+
//~| HELP if a comment was intended use `//`
55
}

src/test/ui/parser/doc-before-fn-rbrace.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0585]: found a documentation comment that doesn't document anything
44
LL | /// document
55
| ^^^^^^^^^^^^
66
|
7-
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
7+
= help: doc comments must come before what they document, if a comment was intended use `//`
88

99
error: aborting due to previous error
1010

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

src/test/ui/parser/doc-before-rbrace.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0585]: found a documentation comment that doesn't document anything
44
LL | println!("Hi"); /// hi
55
| ^^^^^^
66
|
7-
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
7+
= help: doc comments must come before what they document, if a comment was intended use `//`
88

99
error: aborting due to previous error
1010

src/test/ui/parser/doc-before-semi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
fn main() {
22
/// hi
33
//~^ ERROR found a documentation comment that doesn't document anything
4-
//~| HELP maybe a comment was intended
4+
//~| HELP if a comment was intended use `//`
55
;
66
}

src/test/ui/parser/doc-before-semi.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0585]: found a documentation comment that doesn't document anything
44
LL | /// hi
55
| ^^^^^^
66
|
7-
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
7+
= help: doc comments must come before what they document, if a comment was intended use `//`
88

99
error: aborting due to previous error
1010

src/test/ui/parser/doc-before-struct-rbrace-1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ struct X {
22
a: u8,
33
/// document
44
//~^ ERROR found a documentation comment that doesn't document anything
5-
//~| HELP maybe a comment was intended
5+
//~| HELP if a comment was intended use `//`
66
}
77

88
fn main() {

src/test/ui/parser/doc-before-struct-rbrace-1.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | a: u8,
77
LL | /// document
88
| ^^^^^^^^^^^^
99
|
10-
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
10+
= help: doc comments must come before what they document, if a comment was intended use `//`
1111

1212
error: aborting due to previous error
1313

src/test/ui/parser/doc-before-struct-rbrace-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
struct X {
22
a: u8 /// document
33
//~^ ERROR found a documentation comment that doesn't document anything
4-
//~| HELP maybe a comment was intended
4+
//~| HELP if a comment was intended use `//`
55
}
66

77
fn main() {

src/test/ui/parser/doc-before-struct-rbrace-2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0585]: found a documentation comment that doesn't document anything
44
LL | a: u8 /// document
55
| ^^^^^^^^^^^^
66
|
7-
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
7+
= help: doc comments must come before what they document, if a comment was intended use `//`
88

99
error: aborting due to previous error
1010

src/test/ui/parser/doc-inside-trait-item.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0584]: found a documentation comment that doesn't document anything
44
LL | /// empty doc
55
| ^^^^^^^^^^^^^ this doc comment doesn't document anything
66
|
7-
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
7+
= help: doc comments must come before what they document, if a comment was intended use `//`
88

99
error: aborting due to previous error
1010

src/test/ui/parser/issues/issue-34222-1.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0585]: found a documentation comment that doesn't document anything
44
LL | /// comment
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
7+
= help: doc comments must come before what they document, if a comment was intended use `//`
88

99
error: aborting due to previous error
1010

src/test/ui/parser/issues/issue-48636.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | x: u8
88
LL | /// The ID of the parent core
99
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1010
|
11-
= help: doc comments must come before what they document, maybe a comment was intended with `//`?
11+
= help: doc comments must come before what they document, if a comment was intended use `//`
1212

1313
error: aborting due to previous error
1414

0 commit comments

Comments
 (0)