Skip to content

Imports: Leading :: shouldn't be stripped. #4102

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
rickvanprim opened this issue Mar 29, 2020 · 2 comments
Closed

Imports: Leading :: shouldn't be stripped. #4102

rickvanprim opened this issue Mar 29, 2020 · 2 comments

Comments

@rickvanprim
Copy link

pub(crate) use ::fnv::FnvHasher;

pub mod fnv;
pub use self::fnv::*;

gets transformed into

pub(crate) use fnv::FnvHasher;

pub mod fnv;
pub use self::fnv::*;

In this case where there's a name overlap, this has a semantically different meaning. I don't think rustfmt should be stripping the leading ::.

@calebcartwright
Copy link
Member

Believe this is a duplicate of #3501. Make sure you are specifying the edition value (either in rustfmt.toml or cli arg) if you are running rustfmt directly

@rickvanprim
Copy link
Author

Good catch, thank you @calebcartwright that appears to fix it!

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

2 participants