Skip to content

Overlong function signature #1049

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
nrc opened this issue Jun 7, 2016 · 9 comments
Closed

Overlong function signature #1049

nrc opened this issue Jun 7, 2016 · 9 comments
Labels
bug Panic, non-idempotency, invalid code, etc. good first issue Issues up for grabs, also good candidates for new rustfmt contributors

Comments

@nrc
Copy link
Member

nrc commented Jun 7, 2016

    pub unsafe fn reborrow_mut(&mut self) -> Handle<NodeRef<marker::Mut, K, V, NodeType>, HandleType> {
@nrc nrc added bug Panic, non-idempotency, invalid code, etc. good first issue Issues up for grabs, also good candidates for new rustfmt contributors labels Jun 7, 2016
@nrc
Copy link
Member Author

nrc commented Jun 7, 2016

Another example:

    pub fn merge(mut self) -> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::Edge> {

@marcusklaas
Copy link
Contributor

How is this possible?

@brson
Copy link

brson commented Jun 27, 2016

Since this is tagged easy, how might one go about fixing it (and #1048)?

@nrc
Copy link
Member Author

nrc commented Jun 27, 2016

I would start here: https://github.com/rust-lang-nursery/rustfmt/blob/master/src/items.rs#L1221 and insert a bunch of printlns (or use a debugger) to figure out the path the code is taking and the widths being passed down to the helper functions, at some point it should be clear that a helper is being asked to format into a width that is one larger than it ought to be. Whilst not being a lot of fun, this is usually quite easy to figure out. Exactly how to fix it depends on what the problem looks like. It might be as simple as adding a constant 1 to something.

@brson brson mentioned this issue Jul 1, 2016
jefftt pushed a commit to jefftt/rustfmt that referenced this issue Jul 24, 2016
jefftt pushed a commit to jefftt/rustfmt that referenced this issue Jul 24, 2016
@jefftt
Copy link

jefftt commented Jul 24, 2016

whoops sorry made a mistake.

Hi! I'm new to rust and took at shot that this issue.

@brson
Copy link

brson commented Jul 30, 2016

@juicejitsu Great! @nrc can you help @juicejitsu land this fix? Looks like they've got a patch ready to go.

@fabric-and-ink
Copy link
Contributor

@juicejitsu I had the same idea like you but there are at least two corner cases which have to be considered. Please have a look at #1089. Maybe you want to finish that PR? Sadly I have nearly no spare time right now...

@jefftt
Copy link

jefftt commented Jul 31, 2016

@dawirstejeck Sure! Taking a look

jefftt pushed a commit to jefftt/rustfmt that referenced this issue Aug 1, 2016
jefftt pushed a commit to jefftt/rustfmt that referenced this issue Aug 1, 2016
@fabric-and-ink
Copy link
Contributor

This can be closed now, right?

@nrc nrc closed this as completed Aug 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Panic, non-idempotency, invalid code, etc. good first issue Issues up for grabs, also good candidates for new rustfmt contributors
Projects
None yet
Development

No branches or pull requests

5 participants