Skip to content

Commit 1c8509b

Browse files
committed
fix(toml): Don't require MSRV bump for pub/priv
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.
1 parent be1bbda commit 1c8509b

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

src/cargo/util/toml/mod.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -786,12 +786,8 @@ fn normalize_dependencies<'a>(
786786
warnings,
787787
)?;
788788
if d.public.is_some() {
789-
let public_feature = features.require(Feature::public_dependency());
790-
let with_public_feature = public_feature.is_ok();
789+
let with_public_feature = features.require(Feature::public_dependency()).is_ok();
791790
let with_z_public = gctx.cli_unstable().public_dependency;
792-
if !with_public_feature && (!with_z_public && !gctx.nightly_features_allowed) {
793-
public_feature?;
794-
}
795791
if matches!(kind, None) {
796792
if !with_public_feature && !with_z_public {
797793
d.public = None;

tests/testsuite/pub_priv.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ fn pub_dev_dependency_without_feature() {
226226
.build();
227227

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

0 commit comments

Comments
 (0)