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

use_try_shorthand = true disallows formatting on chains with comments #6121

Open
Laifsyn opened this issue Mar 21, 2024 · 0 comments
Open

use_try_shorthand = true disallows formatting on chains with comments #6121

Laifsyn opened this issue Mar 21, 2024 · 0 comments

Comments

@Laifsyn
Copy link

Laifsyn commented Mar 21, 2024

rustfmt.toml

# rustfmt.toml
# outdated default — `?` was unstable at the time
# additionally the `try!` macro is deprecated now
use_try_shorthand =true

main.rs

fn main() {
    let e: Result<(), &str> = Ok(());
    let _e = e // hello comment
            .map_err(|_| "This is an error message") // Hello comment - Fails to format
        .map(|_| ());

    println!("Hello, world!");
}```

rustfmt version: 
    `rustfmt 1.7.0-stable (07dca489 2024-02-04)`
Nightly:
    `rustfmt 1.7.0-nightly (1388d7a0 2024-03-20)`
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

No branches or pull requests

1 participant