-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Fix signature by adding parens when needed #42318
Conversation
r? @frewsxcv (rust_highfive has picked a reviewer for you, use r? to override) |
dad75a8
to
171d285
Compare
Looks good, though I think you'll wind up racing #42286 to the merge since you both mess with the signature of |
@bors delegate=QuietMisdreavus |
✌️ @QuietMisdreavus can now approve this pull request |
@bors r+ |
📌 Commit 171d285 has been approved by |
I'll improve the priority a bit then. @bors: p=1 |
@@ -788,14 +797,14 @@ fn fmt_type(t: &clean::Type, f: &mut fmt::Formatter, use_absolute: bool, | |||
_ => { |
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 think it would be better to add a case for ResolvedPath
here to render the parenthesis rather than passing bool parameters everywhere.
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'm not sure it'd be better. But don't hesitate to do it if you think it can be improved.
@@ -534,7 +535,7 @@ fn resolved_path(w: &mut fmt::Formatter, did: DefId, path: &clean::Path, | |||
} else { | |||
format!("{}", HRef::new(did, &last.name)) | |||
}; | |||
write!(w, "{}{}", path, last.params)?; | |||
write!(w, "{}{}{}", if need_paren { "(" } else { "" }, path, last.params)?; |
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.
This is missing the print_all
and w.alternate()
cases above although that won't be an issue if you render the parenthesis in fmt_type
itself like I suggest.
⌛ Testing commit 171d285 with merge fd7b44b... |
…isdreavus Fix signature by adding parens when needed Fixes #42299.
☀️ Test successful - status-appveyor, status-travis |
Fixes #42299.