Skip to content

Commit 9600fda

Browse files
authored
Rollup merge of #77925 - JohnTitor:sugg-min-features, r=davidtwco,oli-obk
Suggest minimal subset features in `incomplete_features` lint This tells users that we have a minimal subset feature of it and they can fix the lint warning without allowing it. The wording improvement is helpful :) Fixes #77913
2 parents 9abf81a + f7150be commit 9600fda

File tree

88 files changed

+95
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+95
-0
lines changed

compiler/rustc_lint/src/builtin.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2288,12 +2288,20 @@ impl EarlyLintPass for IncompleteFeatures {
22882288
n, n,
22892289
));
22902290
}
2291+
if HAS_MIN_FEATURES.contains(&name) {
2292+
builder.help(&format!(
2293+
"consider using `min_{}` instead, which is more stable and complete",
2294+
name,
2295+
));
2296+
}
22912297
builder.emit();
22922298
})
22932299
});
22942300
}
22952301
}
22962302

2303+
const HAS_MIN_FEATURES: &[Symbol] = &[sym::const_generics, sym::specialization];
2304+
22972305
declare_lint! {
22982306
/// The `invalid_value` lint detects creating a value that is not valid,
22992307
/// such as a NULL reference.

src/test/ui/array-slice-vec/match_arr_unknown_len.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ LL | #![feature(const_generics)]
66
|
77
= note: `#[warn(incomplete_features)]` on by default
88
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
9+
= help: consider using `min_const_generics` instead, which is more stable and complete
910

1011
error[E0308]: mismatched types
1112
--> $DIR/match_arr_unknown_len.rs:6:9

src/test/ui/associated-types/defaults-specialization.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ LL | #![feature(associated_type_defaults, specialization)]
66
|
77
= note: `#[warn(incomplete_features)]` on by default
88
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
9+
= help: consider using `min_specialization` instead, which is more stable and complete
910

1011
error[E0053]: method `make` has an incompatible type for trait
1112
--> $DIR/defaults-specialization.rs:19:18

src/test/ui/binding/const-param.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ LL | #![feature(const_generics)]
66
|
77
= note: `#[warn(incomplete_features)]` on by default
88
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
9+
= help: consider using `min_const_generics` instead, which is more stable and complete
910

1011
error[E0158]: const parameters cannot be referenced in patterns
1112
--> $DIR/const-param.rs:7:9

src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ LL | #![feature(specialization)]
66
|
77
= note: `#[warn(incomplete_features)]` on by default
88
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
9+
= help: consider using `min_specialization` instead, which is more stable and complete
910

1011
error[E0391]: cycle detected when building specialization graph of trait `Trait`
1112
--> $DIR/coherence-inherited-assoc-ty-cycle-err.rs:9:1

src/test/ui/const-generics/defaults/wrong-order.full.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ LL | #![cfg_attr(full, feature(const_generics))]
1414
|
1515
= note: `#[warn(incomplete_features)]` on by default
1616
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
17+
= help: consider using `min_const_generics` instead, which is more stable and complete
1718

1819
error: aborting due to previous error; 1 warning emitted
1920

src/test/ui/const-generics/issues/issue-56445.full.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ LL | #![cfg_attr(full, feature(const_generics))]
66
|
77
= note: `#[warn(incomplete_features)]` on by default
88
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
9+
= help: consider using `min_const_generics` instead, which is more stable and complete
910

1011
error[E0771]: use of non-static lifetime `'a` in const generic
1112
--> $DIR/issue-56445.rs:9:26

src/test/ui/const-generics/issues/issue-60818-struct-constructors.full.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ LL | #![cfg_attr(full, feature(const_generics))]
66
|
77
= note: `#[warn(incomplete_features)]` on by default
88
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
9+
= help: consider using `min_const_generics` instead, which is more stable and complete
910

1011
warning: 1 warning emitted
1112

src/test/ui/const-generics/issues/issue-61336-1.full.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ LL | #![cfg_attr(full, feature(const_generics))]
66
|
77
= note: `#[warn(incomplete_features)]` on by default
88
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
9+
= help: consider using `min_const_generics` instead, which is more stable and complete
910

1011
warning: 1 warning emitted
1112

src/test/ui/const-generics/issues/issue-61336-2.full.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ LL | #![cfg_attr(full, feature(const_generics))]
66
|
77
= note: `#[warn(incomplete_features)]` on by default
88
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
9+
= help: consider using `min_const_generics` instead, which is more stable and complete
910

1011
error[E0277]: the trait bound `T: Copy` is not satisfied
1112
--> $DIR/issue-61336-2.rs:10:5

0 commit comments

Comments
 (0)