We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
imports_granularity = "Module"
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
rustfmt.toml:
rustfmt.toml
edition = "2018" # not sure if this is necessary for repro imports_granularity = "Module"
main.rs (pre formatting):
main.rs
use std::collections::HashMap; use std::collections::HashMap as HM; fn f(_: &HM<i32, i32>) {} fn main() { let x = HashMap::new(); f(&x); }
main.rs (post formatting):
use std::collections::HashMap; fn f(_: &HM<i32, i32>) {} fn main() { let x = HashMap::new(); f(&x); }
removing the HashMap as HM alias causes the code to no longer compile.
HashMap as HM
The text was updated successfully, but these errors were encountered:
Thanks for reaching out.
By the way, what version of rustfmt are you using? I believe this has been fixed in master by #5209.
Using rustfmt 1.4.38-nightly (8b0b213c 2022-01-29) I get the following when reformatting your snippet using your specified configuration options:
rustfmt 1.4.38-nightly (8b0b213c 2022-01-29)
use std::collections::{HashMap, HashMap as HM}; fn f(_: &HM<i32, i32>) {} fn main() { let x = HashMap::new(); f(&x); }
Sorry, something went wrong.
Thanks for sharing but closing as a duplicate. It hasn't been released yet but the fix will hit nightly the next time we run a sync
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
rustfmt.toml
:main.rs
(pre formatting):main.rs
(post formatting):removing the
HashMap as HM
alias causes the code to no longer compile.The text was updated successfully, but these errors were encountered: