about summary refs log tree commit diff
path: root/compiler/rustc_resolve
diff options
context:
space:
mode:
authorlcnr <rust@lcnr.de>2021-04-29 20:06:11 +0200
committerlcnr <rust@lcnr.de>2021-04-29 20:44:19 +0200
commitda6261e07fa892f995703e4ae26832a633fa5a23 (patch)
treea43b11baba471fbbad29d8fe2adbc7ee057806c9 /compiler/rustc_resolve
parent814a560072c305d274affc78219e4a7e0558252f (diff)
downloadrust-da6261e07fa892f995703e4ae26832a633fa5a23.tar.gz
rust-da6261e07fa892f995703e4ae26832a633fa5a23.zip
make feature recommendations optional
Diffstat (limited to 'compiler/rustc_resolve')
-rw-r--r--compiler/rustc_resolve/src/diagnostics.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs
index c5f12c0c691..6ea46f5c528 100644
--- a/compiler/rustc_resolve/src/diagnostics.rs
+++ b/compiler/rustc_resolve/src/diagnostics.rs
@@ -487,7 +487,13 @@ impl<'a> Resolver<'a> {
                         name
                     ));
                 }
-                err.help("use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions");
+
+                if self.session.is_nightly_build() {
+                    err.help(
+                        "use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` \
+                        to allow generic const expressions"
+                    );
+                }
 
                 err
             }