Skip to content

Commit 4bb6925

Browse files
committed
Push warning directly to warning vec
1 parent 792a270 commit 4bb6925

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/cargo/util/toml/mod.rs

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

1024-
let warn_default_feat = summary.features().contains_key("default-features");
1024+
if summary.features().contains_key("default-features") {
1025+
warnings.push(
1026+
"`default-features = [\"..\"]` was found in [features]. \
1027+
Did you mean to use `default = [\"..\"]`?".to_string()
1028+
)
1029+
}
10251030

10261031
let custom_metadata = project.metadata.clone();
10271032
let mut manifest = Manifest::new(
@@ -1058,12 +1063,6 @@ impl TomlManifest {
10581063
for error in errors {
10591064
manifest.warnings_mut().add_critical_warning(error);
10601065
}
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-
}
10671066

10681067
manifest.feature_gate()?;
10691068

0 commit comments

Comments
 (0)