Skip to content

Symbols after question mark is duplicated #985

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
JIghtuse opened this issue May 10, 2016 · 1 comment
Closed

Symbols after question mark is duplicated #985

JIghtuse opened this issue May 10, 2016 · 1 comment
Labels
bug Panic, non-idempotency, invalid code, etc.

Comments

@JIghtuse
Copy link

When you run rustfmt on a code with question mark, it duplicate symbols after it. For example, this:

#![feature(question_mark)]

fn foo() -> Result<i32, &'static str> {
    Ok(3)
}

fn bar() -> Result<i32, &'static str> {
    Ok(foo()?.pow(2))                                 // <- one dot
}

fn main() {
    println!("{:?}", bar());
}

Will become this:

#![feature(question_mark)]

fn foo() -> Result<i32, &'static str> {
    Ok(3)
}

fn bar() -> Result<i32, &'static str> {
    Ok(foo()?..pow(2))                                 // <- two dots
}

fn main() {
    println!("{:?}", bar());
}

Life example: https://is.gd/jo9cQ9

@nrc nrc added the bug Panic, non-idempotency, invalid code, etc. label May 10, 2016
@nrc nrc added this to the 1.0 milestone May 10, 2016
@marcusklaas
Copy link
Contributor

Closed by #893.

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

3 participants