Skip to content

Allow bare CR in ////-style comment.#41827

Merged
bors merged 1 commit into
rust-lang:masterfrom
qnighy:allow-bare-cr-in-nondoc-comment
May 9, 2017
Merged

Allow bare CR in ////-style comment.#41827
bors merged 1 commit into
rust-lang:masterfrom
qnighy:allow-bare-cr-in-nondoc-comment

Conversation

@qnighy

@qnighy qnighy commented May 8, 2017

Copy link
Copy Markdown
Contributor

Fixes #40624 in a way that bare CR is allowed in all non-doc comments.

@rust-highfive

Copy link
Copy Markdown
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@estebank

estebank commented May 8, 2017

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@bors

bors commented May 8, 2017

Copy link
Copy Markdown
Collaborator

📌 Commit 0e8e45c has been approved by estebank

frewsxcv added a commit to frewsxcv/rust that referenced this pull request May 9, 2017
…ent, r=estebank

Allow bare CR in ////-style comment.

Fixes rust-lang#40624 in a way that bare CR is allowed in all non-doc comments.
bors added a commit that referenced this pull request May 9, 2017
Rollup of 8 pull requests

- Successful merges: #41293, #41520, #41827, #41828, #41833, #41836, #41838, #41842
- Failed merges:
@bors bors merged commit 0e8e45c into rust-lang:master May 9, 2017
@qnighy qnighy deleted the allow-bare-cr-in-nondoc-comment branch May 9, 2017 10:12
@nikomatsakis

Copy link
Copy Markdown
Contributor

@qnighy thanks for the bug fix! But I have a question. I think the more fundamental problem here is that the test for "is this a doc comment" is kind of "open-coded" here. That boolean that you modified might be better called "starts-with-triple-slash" or "is-maybe-doc-comment". If you look a bit later on in the file, you'll see some logic that invokes is_doc_comment() to test whether the comment is really a doc-comment. Do you think you could modify the \r test to use that helper so that things are more DRY?

@qnighy

qnighy commented May 10, 2017

Copy link
Copy Markdown
Contributor Author

@nikomatsakis I've left it undone because scan_block_comment() does the similar thing and I thought it might be on purpose. If not, I will sort it out when I have time.

@nikomatsakis

Copy link
Copy Markdown
Contributor

@qnighy not that I know of...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants