Skip to content
This repository was archived by the owner on Nov 24, 2023. It is now read-only.

Attributes applied to deleted items should also be deleted. #147

Closed
jrobsonchase opened this issue Sep 20, 2018 · 5 comments
Closed

Attributes applied to deleted items should also be deleted. #147

jrobsonchase opened this issue Sep 20, 2018 · 5 comments

Comments

@jrobsonchase
Copy link

For example, if I have

#[cfg(unix)]
extern crate nix;

mod foo;

and then run cargo fix --edition-idioms, currently only the extern crate nix; line gets deleted, which makes the #[cfg(unix)] attribute apply to mod foo;, which is not what was intended.

I'm currently using cargo-fix v0.4.1 from crates.io.

@Manishearth
Copy link
Member

Manishearth commented Sep 20, 2018 via email

@killercup
Copy link
Member

Wow, looks like a good catch!

That's actually a bug with the rust compiler, which outputs the diagnostic info, though. Can you open an issue at https://github.com/rust-lang/rust/issues? Otherwise I can do it.

@killercup
Copy link
Member

@Manishearth y u so quick

Also, neither rustfix nor cargo-fix (which lives in the cargo repo) has no knowledge of the source code's semantics. cargo-fix will try to pass cfgs, though…

@jrobsonchase
Copy link
Author

@killercup @Manishearth Sure thing! 👍

@killercup
Copy link
Member

@jrobsonchase thanks so much for reporting this… twice! Closing this issue here in favor of rust-lang/rust#54400.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants