Skip to content

Commit 792a270

Browse files
committed
Add delayed warning to manifest. Pass test
1 parent 86037b8 commit 792a270

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/cargo/util/toml/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,8 @@ impl TomlManifest {
10211021
None => false,
10221022
};
10231023

1024+
let warn_default_feat = summary.features().contains_key("default-features");
1025+
10241026
let custom_metadata = project.metadata.clone();
10251027
let mut manifest = Manifest::new(
10261028
summary,
@@ -1056,6 +1058,12 @@ impl TomlManifest {
10561058
for error in errors {
10571059
manifest.warnings_mut().add_critical_warning(error);
10581060
}
1061+
if warn_default_feat {
1062+
manifest.warnings_mut().add_warning(
1063+
"`default-features = [\"..\"]` was found in [features]. \
1064+
Did you mean to use `default = [\"..\"]`?".to_string()
1065+
);
1066+
}
10591067

10601068
manifest.feature_gate()?;
10611069

0 commit comments

Comments
 (0)