Skip to content
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

"internal error: left behind trailing whitespace" with long lines #3295

Closed
Naddiseo opened this issue Jan 25, 2019 · 4 comments
Closed

"internal error: left behind trailing whitespace" with long lines #3295

Naddiseo opened this issue Jan 25, 2019 · 4 comments
Labels
bug Panic, non-idempotency, invalid code, etc.

Comments

@Naddiseo
Copy link

Using rustfmt-nightly (1.0.1-nightly) I get "internal error: left behind trailing whitespace" for the following sample program:

use std::fmt::{self, Display};
pub enum FooLongEnum { AVeryLongEnumName ,BNotherLongEnumName }
impl Display for Foo {
	fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
		let description = match self {
			FooLongEnum::AVeryLongEnumName => String::from("this is a very very very very very very very very very very very very very very very very long string"),
			
		
		};
		write!(f, "{}", description)
	}
}
@scampi scampi added the bug Panic, non-idempotency, invalid code, etc. label Jan 26, 2019
@scampi
Copy link
Contributor

scampi commented Jan 26, 2019

do you have any custom configuration ?

@Naddiseo
Copy link
Author

Not to my knowledge. I found it in a project I started yesterday, and hadn't configured anything.

@rchaser53
Copy link
Contributor

I'd like to work on this.
I created a small reproducible code like below.

pub enum TestEnum {
    a,
    b,
}

fn test_fn(input: TestEnum) {
    match input {
        TestEnum::a => String::from("aaa"),
        TestEnum::b => String::from("this is a very very very very very very very very very very very very very very very ong string"),
        
    };
}

I found format_expr return None in rewrite_match_body.
Maybe I can resolve this issue.

@topecongiro
Copy link
Contributor

cc #3206.

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.
Projects
None yet
Development

No branches or pull requests

4 participants