-
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
rustfmt on metadata folder #37349
rustfmt on metadata folder #37349
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
@nikomatsakis LGTM. What do you think? |
Didn't you already do this in #37350? |
I split the folder into two PRs since it is huge |
@srinivasreddy There's no size limit to GitHub PRs and it's not helpful to have related changes split. Also, you'll likely have to wait for #37301 to get merged, in order to not have conflicts. |
@eddyb I know that. I just wanted to avoid merge conflicts with merged PRs in between. 😄 |
pub fn find_plugin_registrar(&mut self, span: Span, name: &str) | ||
pub fn find_plugin_registrar(&mut self, | ||
span: Span, | ||
name: &str) |
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.
Is there a reason rustfmt
gives each argument its own line here?
I think it just wastes vertical space without helping readability.
ident: name.to_string(), | ||
id: ast::DUMMY_NODE_ID, | ||
should_link: false, | ||
}); |
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.
IMO, the massive rightward drift here is ugly -- I think the original formatting looks much nicer.
None, | ||
item.span, | ||
PathKind::Crate, | ||
true); |
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 prefer the original formatting here.
@@ -215,20 +217,25 @@ impl CStore { | |||
// In order to get this left-to-right dependency ordering, we perform a | |||
// topological sort of all crates putting the leaves at the right-most | |||
// positions. | |||
pub fn do_get_used_crates(&self, prefer: LinkagePreference) | |||
pub fn do_get_used_crates(&self, | |||
prefer: LinkagePreference) |
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.
(also here -- no need for the added line break)
id, self.from_id_range, self.to_id_range); | ||
id, | ||
self.from_id_range, | ||
self.to_id_range); |
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.
IMO, this is more readable as it was with the arguments one one line.
debug!("evaluating the type of {:?}::{:?}", variant.name, field.name); | ||
debug!("evaluating the type of {:?}::{:?}", | ||
variant.name, | ||
field.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.
Not sure why rustfmt
breaks up this line...
variant.name, field.name, ty); | ||
variant.name, | ||
field.name, | ||
ty); |
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.
(same here -- I think this is more readable as it was with these arguments on one line)
}); | ||
} | ||
} | ||
continue; | ||
} | ||
EntryKind::Impl(_) | EntryKind::DefaultImpl(_) => continue, | ||
EntryKind::Impl(_) | | ||
EntryKind::DefaultImpl(_) => continue, |
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.
Needless line break.
callback(def::Export { | ||
def: ctor_def, | ||
name: 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.
I think this is more readable as it was (I think of the struct's fields as named arguments here).
end_pos, | ||
lines, | ||
multibyte_chars, | ||
.. } = filemap_to_import; |
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.
IMO this looked much nicer before with block indenting and a newline after the {
.
☔ The latest upstream changes (presumably #37301) made this pull request unmergeable. Please resolve the merge conflicts. |
@jseyfried I suggest you open some issues on rustfmt =) |
@bors r+ rollup |
📌 Commit cac3e5a has been approved by |
rustfmt on metadata folder
No description provided.