Skip to content
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

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

Merged
merged 1 commit into from
May 9, 2017

Conversation

qnighy
Copy link
Contributor

@qnighy qnighy commented May 8, 2017

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

@rust-highfive
Copy link
Collaborator

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
Copy link
Contributor

estebank commented May 8, 2017

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 8, 2017

📌 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
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
Copy link
Contributor Author

qnighy commented May 10, 2017

@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
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