Skip to content

cargo fix can fail if cfg(test) gated code causes warnings without test #9594

Open
@Volker-Weissmann

Description

@Volker-Weissmann

My project runs cargo test with warnings, but successful, and if I run cargo fix, cargo test reports a build error

$ git clone https://gitlab.com/volkerweissmann/math_dsl_macro
$ cd math_dsl_macro
$ git checkout c19efa4fd2549185287c851ea9348a18f5eb461a
$ cargo test
  warnings but everything passes
$ cargo fix
$ cargo test
 compile error

Correct me if I'm wrong, but I don't think this is intended to ever happen. If it is intended, you can close this issue, if it's not intended, it's a bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    Command-fixS-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions