mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
Add failing test for issue #6370
This commit is contained in:
parent
485670b398
commit
86037b8ab6
@ -1730,3 +1730,35 @@ fn feature_off_dylib() {
|
||||
// Check that building without `f1` uses a dylib without `f1`.
|
||||
p.cargo("run -p bar").run();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn warn_if_default_features() {
|
||||
let p = project()
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[project]
|
||||
name = "foo"
|
||||
version = "0.0.1"
|
||||
authors = []
|
||||
|
||||
[dependencies.bar]
|
||||
path = "bar"
|
||||
optional = true
|
||||
|
||||
[features]
|
||||
default-features = ["bar"]
|
||||
"#
|
||||
).file("src/main.rs", "fn main() {}")
|
||||
.file("bar/Cargo.toml",&basic_manifest("bar", "0.0.1"))
|
||||
.file("bar/src/lib.rs", "pub fn bar() {}")
|
||||
.build();
|
||||
|
||||
p.cargo("build")
|
||||
.with_stderr("\
|
||||
[WARNING] `default-features = [\"..\"]` was found in [features]. Did you mean to use `default = [\"..\"]`?
|
||||
[COMPILING] foo v0.0.1 ([CWD])
|
||||
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
|
||||
",
|
||||
).run();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user