-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Include parens to type parameter #50205
Include parens to type parameter #50205
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
bb15f0a
to
9462198
Compare
Can you add a test exercising the new code? Other than that, LGTM. |
@estebank Thank you for the feedback! Though I am not sure how I should test the new code, I will try writing some ui tests and see if they work... |
| | ||
LL | trait Tr: ?Sized {} //~ ERROR `?Trait` is not permitted in supertraits | ||
| ^^^^^ |
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.
Though I am not sure how I should test the new code
You can put any of ?Sized
s in this test into parentheses, that would be enough.
src/libsyntax/parse/parser.rs
Outdated
@@ -4671,7 +4677,6 @@ impl<'a> Parser<'a> { | |||
bounds.push(TraitTyParamBound(poly_trait, modifier)); | |||
} | |||
if has_parens { | |||
self.expect(&token::CloseDelim(token::Paren))?; | |||
if let Some(&RegionTyParamBound(..)) = bounds.last() { | |||
self.span_err(self.prev_span, | |||
"parenthesized lifetime bounds are not supported"); |
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.
Nit: Could you move this error into if self.token.is_lifetime()
above as well?
@petrochenkov Thank you for the review! I am going to work on this over the weekend. |
Ping from triage @topecongiro! It's been a while since we heard from you, will you have time to work on this again soon? |
My apologies for the late response. Hopefully over this weekend I may have some time... |
Ping from triage, @topecongiro! How's your weekend looking this time around? |
I have updated the tests and fixed the code based on the review. I am very sorry that this took so long... |
@bors r+ |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@topecongiro could you please rebase your branch into master (even if it doesn't show any merge conflict)? Thanks! |
7f04212
to
dc87d0d
Compare
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Network failure. |
…r=petrochenkov Include parens to type parameter The motivation of this PR is to fix a bug in rustfmt (cc rust-lang/rustfmt#2630).
💔 Test failed - status-travis |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
1 similar comment
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
⌛ Testing commit dc87d0d with merge 838477aa3c50bf337ef415c80a86bf6e393f0787... |
💔 Test failed - status-travis |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
1 similar comment
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
…r=petrochenkov Include parens to type parameter The motivation of this PR is to fix a bug in rustfmt (cc rust-lang/rustfmt#2630).
☀️ Test successful - status-appveyor, status-travis |
The motivation of this PR is to fix a bug in rustfmt (cc rust-lang/rustfmt#2630).