-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Redo PR #24811 properly #24825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redo PR #24811 properly #24825
Conversation
Transplant the grammar-related changes to grammar.md, and remove all grammar talk from reference.md
@bors: r+ rollup |
📌 Commit 85ee89a has been approved by |
@bors: r+ |
📌 Commit d8d5a2f has been approved by |
Comments in Rust code follow the general C++ style of line and block-comment | ||
forms. Nested block comments are supported. | ||
Comments in Rust code follow the general C++ style of line (`//`) and | ||
block-comment (`/* ... */`) forms. Nested block comments are supported. | ||
|
||
Line comments beginning with exactly _three_ slashes (`///`), and block | ||
comments beginning with exactly one repeated asterisk in the block-open |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does /// Foo
really expand to #[doc = "/// Foo"]
? @chris-morgan states it expands to #[doc = " Foo"]
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. I see no reason why Chris Morgan would be wrong. I just didn't think to try it out (honestly didn't even see the triple slash!). I'm currently in the middle of a build, so I can't even check...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meh, rustc --pretty
does not show any #[doc]
attributes, it just regurgitates the triple-slash comments. I don't know how else to test this, since I never worked on the compiler. But since it's clearly not visible for users or ordinary Rust code, I'm fine to say that this doesn't really matter. But since section 6.3.7 (Miscellaneous attributes) does strip the triple slashes, I'll remove them here too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know. What it says seems kinda weird though. You could probably try manually inputting it like: #[doc = "/// Foo"]
and see what rustdoc spits out. That might clarify it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#[doc = "/// Foo"]
results in rustdoc spitting out "/// Foo" as documentation text, so Chris Morgan is definitely right (and by extension, so is my change, yay!).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is purely an implementation detail for now, as far as I'm concerned.
@bors: r- |
64d422c
to
9854eb8
Compare
9854eb8
to
0ea193d
Compare
@bors: r+ rollup |
📌 Commit 0ea193d has been approved by |
Transplant the relevant changes (turns out to be all of them) to `grammar.md`, and remove all grammar talk from `reference.md`. Sorry for the chaos. The second commit, further below, goes over the comments and whitespace sections. r? @steveklabnik
Transplant the relevant changes (turns out to be all of them) to
grammar.md
, and remove all grammar talk fromreference.md
. Sorry for the chaos.The second commit, further below, goes over the comments and whitespace sections.
r? @steveklabnik