-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Rustfmt-ing librustc_front. #29075
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
Rustfmt-ing librustc_front. #29075
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
disr_expr: disr_expr.map(|e| fld.fold_expr(e)), | ||
}, | ||
span: fld.new_span(span), | ||
v.map(|Spanned { node: Variant_ { name, attrs, data, disr_expr }, span }| { |
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.
BTW, I dislike the current formatting of struct literals/struct patterns. I'd even say it discourages their use somewhat.
Compare struct patterns and tuple patterns:
S { name, attrs, data, disr_expr } // those damn 3 extra spaces! I need to type them (okay, rustfmt solve this problem) and they shift the text closer to 100 character limit
S { .. } // even worse, 37.5% of unnecessary symbols
S(name, attrs, data, disr_expr) // nice
S(..) // nice
S{name, attrs, data, disr_expr} // almost as nice
S{..} // almost as nice
r? @nrc |
@@ -1254,7 +1269,6 @@ pub enum Item_ { | |||
|
|||
// Default trait implementations | |||
/// | |||
// `impl Trait for .. {}` |
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.
We lose this comment, I imagine it is because the empty line comment is a doc comment, it should probably lose a /
, then hopefully rustfmt won't screw this up. Needs a fixup.
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 still needs fixing up
Just needs one fixup, r+ with that |
}.into_iter().flat_map(vec_iter) | ||
} | ||
.into_iter() | ||
.flat_map(vec_iter) |
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 pretty sure the above is worse than original.
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.
rustfmt fix is in the works...
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.
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.
Should be fixed now
☔ The latest upstream changes (presumably #29102) made this pull request unmergeable. Please resolve the merge conflicts. |
5dfa87e
to
a09d94c
Compare
@nrc re-ran rustfmt again. Also added a manual fixup. |
@@ -158,7 +158,7 @@ pub fn lower_view_path(_lctx: &LoweringContext, view_path: &ViewPath) -> P<hir:: | |||
id: id, | |||
name: name.name, | |||
rename: rename.map(|x| x.name), | |||
}, | |||
} |
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.
https://github.com/nrc/rustfmt/issues/508
This is causing build to fail
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.
Should also be fixed
Running rustfmt again undid your fixup. I think rather than just reinstating the deleted comment, you need to change the blank line comment from Annoyingly rustfmt has regressed some how and is now deleting a comma. |
☔ The latest upstream changes (presumably #29303) made this pull request unmergeable. Please resolve the merge conflicts. |
// | ||
// FIXME (#3300): Should allow items to be anonymous. Right now | ||
// we just use dummy names for anon items. | ||
// |
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.
https://github.com/nrc/rustfmt/issues/539
Could you fix this manually for now please?
Closing this on favor of #29647 |
Hi Rustaceans!
This is the result of running latest rustfmt on librustc_front!
//cc @nrc