Skip to content

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

Closed

Conversation

goyox86
Copy link
Contributor

@goyox86 goyox86 commented Oct 15, 2015

Hi Rustaceans!

This is the result of running latest rustfmt on librustc_front!

//cc @nrc

@rust-highfive
Copy link
Contributor

r? @alexcrichton

(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 }| {
Copy link
Contributor

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

@alexcrichton
Copy link
Member

r? @nrc

@rust-highfive rust-highfive assigned nrc and unassigned alexcrichton Oct 15, 2015
@@ -1254,7 +1269,6 @@ pub enum Item_ {

// Default trait implementations
///
// `impl Trait for .. {}`
Copy link
Member

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.

Copy link
Member

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

@nrc
Copy link
Member

nrc commented Oct 15, 2015

Just needs one fixup, r+ with that

}.into_iter().flat_map(vec_iter)
}
.into_iter()
.flat_map(vec_iter)
Copy link
Contributor

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.

Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fixed now

@bors
Copy link
Collaborator

bors commented Oct 17, 2015

☔ The latest upstream changes (presumably #29102) made this pull request unmergeable. Please resolve the merge conflicts.

@goyox86 goyox86 force-pushed the goyox86/rustfmting-librustc_front branch from 5dfa87e to a09d94c Compare October 21, 2015 13:38
@goyox86
Copy link
Contributor Author

goyox86 commented Oct 21, 2015

@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),
},
}
Copy link
Member

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also be fixed

@nrc
Copy link
Member

nrc commented Oct 21, 2015

Running rustfmt again undid your fixup. I think rather than just reinstating the deleted comment, you need to change the blank line comment from /// to //, then rustfmt should not delete the comment again.

Annoyingly rustfmt has regressed some how and is now deleting a comma.

@bors
Copy link
Collaborator

bors commented Oct 26, 2015

☔ 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.
//
Copy link
Member

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?

@goyox86
Copy link
Contributor Author

goyox86 commented Nov 5, 2015

Closing this on favor of #29647

@goyox86 goyox86 closed this Nov 5, 2015
bors added a commit that referenced this pull request Nov 9, 2015
…=nrc

Hi Rustaceans!

This is the second take  on running latest rustfmt on librustc_front!

This is the same in #29075 but cleaned. All fixups have been applied.

//cc @nrc
bors added a commit that referenced this pull request Nov 10, 2015
…=nrc

Hi Rustaceans!

This is the second take  on running latest rustfmt on librustc_front!

This is the same in #29075 but cleaned. All fixups have been applied.

//cc @nrc
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.

7 participants