mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
refactor(features): Remove redundant is_local
Its the caller's job to decide whether the warning is relevant
This commit is contained in:
parent
9882ab3260
commit
00d542f58a
@ -546,7 +546,6 @@ impl Features {
|
|||||||
warnings: &mut Vec<String>,
|
warnings: &mut Vec<String>,
|
||||||
) -> CargoResult<()> {
|
) -> CargoResult<()> {
|
||||||
let nightly_features_allowed = self.nightly_features_allowed;
|
let nightly_features_allowed = self.nightly_features_allowed;
|
||||||
let is_local = self.is_local;
|
|
||||||
let Some((slot, feature)) = self.status(feature_name) else {
|
let Some((slot, feature)) = self.status(feature_name) else {
|
||||||
bail!("unknown cargo feature `{}`", feature_name)
|
bail!("unknown cargo feature `{}`", feature_name)
|
||||||
};
|
};
|
||||||
@ -567,19 +566,15 @@ impl Features {
|
|||||||
|
|
||||||
match feature.stability {
|
match feature.stability {
|
||||||
Status::Stable => {
|
Status::Stable => {
|
||||||
// The user can't do anything about non-local packages.
|
let warning = format!(
|
||||||
// Warnings are usually suppressed, but just being cautious here.
|
"the cargo feature `{}` has been stabilized in the {} \
|
||||||
if is_local {
|
|
||||||
let warning = format!(
|
|
||||||
"the cargo feature `{}` has been stabilized in the {} \
|
|
||||||
release and is no longer necessary to be listed in the \
|
release and is no longer necessary to be listed in the \
|
||||||
manifest\n {}",
|
manifest\n {}",
|
||||||
feature_name,
|
feature_name,
|
||||||
feature.version,
|
feature.version,
|
||||||
see_docs()
|
see_docs()
|
||||||
);
|
);
|
||||||
warnings.push(warning);
|
warnings.push(warning);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Status::Unstable if !nightly_features_allowed => bail!(
|
Status::Unstable if !nightly_features_allowed => bail!(
|
||||||
"the cargo feature `{}` requires a nightly version of \
|
"the cargo feature `{}` requires a nightly version of \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user