Skip to content

Commit

Permalink
fix(toml): Don't require MSRV bump for pub/priv
Browse files Browse the repository at this point in the history
In rust-lang#13308, we decided to make the feature gate for public/private
dependencies non-blocking.
Generally, people opt-in to a feature that is non-blocking through `-Z`
but some nightly users want an "always on" mode for this, so we offered
both in rust-lang#13340.
In rust-lang#13340, we made both feature gates work but we did not make them
non-blocking for stable, only nightly.

This change makes the feature gate non-blocking on stable.
  • Loading branch information
epage authored and dingxiangfei2009 committed Sep 17, 2024
1 parent cd8cd33 commit a1f6864
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
6 changes: 1 addition & 5 deletions src/cargo/util/toml/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -786,12 +786,8 @@ fn normalize_dependencies<'a>(
warnings,
)?;
if d.public.is_some() {
let public_feature = features.require(Feature::public_dependency());
let with_public_feature = public_feature.is_ok();
let with_public_feature = features.require(Feature::public_dependency()).is_ok();
let with_z_public = gctx.cli_unstable().public_dependency;
if !with_public_feature && (!with_z_public && !gctx.nightly_features_allowed) {
public_feature?;
}
if matches!(kind, None) {
if !with_public_feature && !with_z_public {
d.public = None;
Expand Down
1 change: 0 additions & 1 deletion tests/testsuite/pub_priv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ fn pub_dev_dependency_without_feature() {
.build();

p.cargo("check --message-format=short")
.masquerade_as_nightly_cargo(&["public-dependency"])
.with_stderr_data(str![[r#"
[WARNING] 'public' specifier can only be used on regular dependencies, not dev-dependencies
[UPDATING] `dummy-registry` index
Expand Down

0 comments on commit a1f6864

Please sign in to comment.