File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
compiler/rustc_expand/src Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -387,7 +387,11 @@ impl<'a> StripUnconfigured<'a> {
387387 ) ;
388388
389389 if attr. is_doc_comment ( ) {
390- err. help ( "`///` is for documentation comments. For a plain comment, use `//`." ) ;
390+ err. help ( if attr. style == AttrStyle :: Outer {
391+ "`///` is used for outer documentation comments; for a plain comment, use `//`."
392+ } else {
393+ "`//!` is used for inner documentation comments; for a plain comment, use `//` by removing the `!` or inserting a space in between them: `// !`"
394+ } ) ;
391395 }
392396
393397 err. emit ( ) ;
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ LL | /// foo
1717 = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
1818 = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
1919 = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
20- = help: `///` is for documentation comments. For a plain comment, use `//`.
20+ = help: `///` is used for outer documentation comments; for a plain comment, use `//`.
2121
2222error[E0658]: attributes on expressions are experimental
2323 --> $DIR/feature-gate-stmt_expr_attributes.rs:10:5
@@ -28,7 +28,7 @@ LL | //! foo
2828 = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
2929 = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
3030 = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
31- = help: `/// ` is for documentation comments. For a plain comment, use `//`.
31+ = help: `//! ` is used for inner documentation comments; for a plain comment, use `//` by removing the `!` or inserting a space in between them: `// !`
3232
3333error: aborting due to 3 previous errors
3434
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ LL | /// useless doc comment
1313 = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
1414 = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
1515 = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
16- = help: `///` is for documentation comments. For a plain comment, use `//`.
16+ = help: `///` is used for outer documentation comments; for a plain comment, use `//`.
1717
1818error: unused doc comment
1919 --> $DIR/unused-doc-comments-edge-cases.rs:6:9
You can’t perform that action at this time.
0 commit comments