about summary refs log tree commit diff
path: root/compiler/rustc_lint/src
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2020-10-14 08:35:32 +0900
committerYuki Okushi <huyuumi.dev@gmail.com>2020-10-17 02:01:08 +0900
commitf7150be6745905b83f88c5397b15233f38d2a8be (patch)
tree9064d27837705a8222db09899f85d2304b5ff4f5 /compiler/rustc_lint/src
parenta78a62fc996ba16f7a111c99520b23f77029f4eb (diff)
Suggest minimal subset features in `incomplete_features` lint
Diffstat (limited to 'compiler/rustc_lint/src')
-rw-r--r--compiler/rustc_lint/src/builtin.rs8
1 files changed, 8 insertions, 0 deletions
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.