Skip to content

Commit 2ddc46a

Browse files
committed
Auto merge of #14507 - epage:public-on-stable, r=weihanglo
fix(toml): Don't require MSRV bump for pub/priv ### What does this PR try to resolve? In #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 #13340. In #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. Unfortunately, this means that 1.83 will be the MSRV for people using public dependencies. Good thing the feature is indefinitely blocked in rustc as that gives us more time. ### How should we test and review this PR? ### Additional information
2 parents dcb4ef9 + 1c8509b commit 2ddc46a

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

src/cargo/util/toml/mod.rs

+1-5
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

-1
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)