Skip to content

Default annotation incorrectly removed on associated types #1255

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
mwolting opened this issue Dec 25, 2016 · 1 comment
Closed

Default annotation incorrectly removed on associated types #1255

mwolting opened this issue Dec 25, 2016 · 1 comment
Labels
bug Panic, non-idempotency, invalid code, etc. good first issue Issues up for grabs, also good candidates for new rustfmt contributors

Comments

@mwolting
Copy link

Similar to #945. Occurs when formatting e.g. code equivalent to the following:

#![feature(specialization)]

trait Trait {
    type Type;
}
impl<T> Trait for T {
    default type Type = u64;
}

The default annotation on Type in the generic implementation of Trait disappears, even though it is meaningful and correct in that position.

@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 Dec 27, 2016
gypsydave5 added a commit to gypsydave5/rustfmt that referenced this issue Feb 23, 2017
@gypsydave5
Copy link
Contributor

I'm going to (try) and take a look at this over the next few days - I'm new to Rust but I'd like to try and get a bit more involved.

gypsydave5 added a commit to gypsydave5/rustfmt that referenced this issue Feb 26, 2017
gypsydave5 added a commit to gypsydave5/rustfmt that referenced this issue Feb 26, 2017
New function to perform formatting on `ImplItems`.
gypsydave5 added a commit to gypsydave5/rustfmt that referenced this issue Feb 26, 2017
Default annotation incorrectly removed on associated type.
gypsydave5 added a commit to gypsydave5/rustfmt that referenced this issue Feb 26, 2017
Default annotation incorrectly removed on associated types

Fixed by adding a specific function to perform formatting on `ImplItems`.
@nrc nrc closed this as completed in eff665c Feb 26, 2017
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

3 participants