Skip to content

Unused patch warnings when using -Zbuild-std with -Zbuild-std-features=compiler-builtins-mem #8963

Closed
@phil-opp

Description

@phil-opp

Problem

There are multiple Patch [...] was not used in the crate graph warnings when building a project using -Zbuild-std and -Zbuild-std-features=compiler-builtins-mem on nightly:

Warning output

warning: Patch gimli v0.23.0 (/home/philipp/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/vendor/gimli) was not used in the crate graph.
Patch object v0.22.0 (/home/philipp/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/vendor/object) was not used in the crate graph.
Patch adler v0.2.3 (/home/philipp/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/vendor/adler) was not used in the crate graph.
Patch addr2line v0.14.0 (/home/philipp/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/vendor/addr2line) was not used in the crate graph.
Patch miniz_oxide v0.4.0 (/home/philipp/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/vendor/miniz_oxide) was not used in the crate graph.
Check that the patched package version and available features are compatible
with the dependency requirements. If the patch has a different version from
what is locked in the Cargo.lock file, run cargo update to use the new
version. This may also occur with an optional dependency that is not enabled.

Steps

  1. cargo new --lib example && cd example
  2. echo "#![no_std]" > src/lib.rs
  3. cargo +nightly check --target x86_64-unknown-linux-gnu -Z build-std=core -Zbuild-std-features=compiler-builtins-mem

(The actual target doesn't seem to matter, the build-std feature just requires that we pass a --target argument.)

Notes

These warnings appeared between d5556ae...2af662e. My guess is that #8834 introduced them. They still happen on the latest nightly.

Output of cargo version:

cargo 1.50.0-nightly (d274fcf 2020-12-07)
release: 1.50.0
commit-hash: d274fcf
commit-date: 2020-12-07

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