From f7150be6745905b83f88c5397b15233f38d2a8be Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Wed, 14 Oct 2020 08:35:32 +0900 Subject: Suggest minimal subset features in `incomplete_features` lint --- compiler/rustc_lint/src/builtin.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'compiler/rustc_lint/src') diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index abd899e8db4..a7db9199665 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -2288,12 +2288,20 @@ impl EarlyLintPass for IncompleteFeatures { n, n, )); } + if HAS_MIN_FEATURES.contains(&name) { + builder.help(&format!( + "consider using `min_{}` instead, which is more stable and complete", + name, + )); + } builder.emit(); }) }); } } +const HAS_MIN_FEATURES: &[Symbol] = &[sym::const_generics, sym::specialization]; + declare_lint! { /// The `invalid_value` lint detects creating a value that is not valid, /// such as a NULL reference. -- cgit 1.4.1-3-g733a5