Skip to content

cargo fix fails to apply all -Wunreachable-pub hints #6465

@matthiaskrgr

Description

@matthiaskrgr
git clone https://github.com/rust-lang/cargo/
cd cargo
git checkout 0d1f1bbeabd5b43a7f3ecfa16540af8e76d5efb4
RUSTFLAGS="-Wunreachable-pub" cargo fix
   Compiling cargo v0.34.0 (/home/matthias/vcs/github/cargo)
warning: failed to automatically apply fixes suggested by rustc to crate `cargo`

after fixes were automatically applied the compiler reported errors within these files:

  * src/cargo/core/compiler/context/mod.rs
  * src/cargo/core/compiler/mod.rs
  * src/cargo/core/resolver/context.rs
  * src/cargo/util/mod.rs

This likely indicates a bug in either rustc or cargo itself,
and we would appreciate a bug report! You're likely to see
a number of compiler warnings after this message which cargo
attempted to fix but failed. If you could open an issue at
https://github.com/rust-lang/cargo/issues
quoting the full output of this command we'd be very appreciative!

warning: unreachable `pub` item
  --> src/cargo/macros.rs:43:1
   |
43 | pub struct DisplayAsDebug<T>(pub T);
   | ---^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   | |
   | help: consider restricting its visibility: `pub(crate)`
   |
   = note: requested on the command line with `-W unreachable-pub`
   = help: or consider exporting it for use by other crates

(followed my a lot more warnings).

cargo 1.33.0-nightly (2cf1f5dda 2018-12-11)
release: 1.33.0
commit-hash: 2cf1f5dda2f7ed84e94c4d32f643e0f1f15352f0
commit-date: 2018-12-11

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions