Closed
Description
Problem
1.43.0-nightly (4ad624882 2020-03-03)
has regressed handling of debug assertions with features.
Steps
-
Install
1.43.0-nightly (4ad624882 2020-03-03)
-
Build a crate with the following Cargo.toml
[package]
name = "test-bin"
version = "0.1.0"
edition = "2018"
[dependencies]
rocket_contrib = { version = "0.4.2", features = [ "templates", "tera_templates" ] }
- Build fails with:
Compiling rocket_contrib v0.4.3
error[E0463]: can't find crate for `notify`
--> /opt/rust/registry/src/crates-io-27bb2a0041c1489d/rocket_contrib-0.4.3/src/templates/fairing.rs:35:5
|
35 | extern crate notify;
| ^^^^^^^^^^^^^^^^^^^^ can't find crate
error: aborting due to previous error
For more information about this error, try `rustc --explain E0463`.
error: could not compile `rocket_contrib`.
To learn more, run the command again with --verbose.
Cargo has not downloaded the required crate, so I assume a Cargo bug, instead of a rustc bug.
- Build works with
cargo 1.43.0-nightly (e57bd0299 2020-02-21)
Possible Solution(s)
Dependency is pulled in via a debug assertion:
https://github.com/SergioBenitez/Rocket/blob/v0.4.2/contrib/lib/Cargo.toml#L79-L80
notify
is not downloaded by Cargo during a clean build.
Cargo.lock
does reference notify
:
[[package]]
name = "rocket_contrib"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "66926894ef94396204c53885f54a1b0e94a88ce6c9478c2fd403261fc0efb523"
dependencies = [
"glob 0.3.0",
"log 0.4.8",
"notify",
"rocket",
"serde",
"serde_json",
"tera",
]
This is a recent regression - rust version 1.43.0-nightly (d3c79346a 2020-02-29)
also works.
Suspect #7962 is at fault,.