This repository was archived by the owner on Nov 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 62
Attributes applied to deleted items should also be deleted. #147
Comments
Could you file this issue on the rust repo itself? rustfix dumbly applies
suggestions from the compiler
That said, it might be worth catching this specific case in rustfix itself
since due to the way the compiler works it might be tricky to generate this
suggestion
…On Thu, Sep 20, 2018, 9:56 PM Josh Robson Chase ***@***.***> wrote:
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.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#147>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/ABivSFvcpQvbcOQ5RKNEQpDj3f6iD3HCks5uc8GsgaJpZM4WyfNn>
.
|
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. |
@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… |
@killercup @Manishearth Sure thing! 👍 |
@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.
For example, if I have
and then run
cargo fix --edition-idioms
, currently only theextern crate nix;
line gets deleted, which makes the#[cfg(unix)]
attribute apply tomod foo;
, which is not what was intended.I'm currently using cargo-fix v0.4.1 from crates.io.
The text was updated successfully, but these errors were encountered: