]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_passes/src/check_const.rs
Replacing bound vars is actually instantiating a binder
[rust.git] / compiler / rustc_passes / src / check_const.rs
index dd8c646a43c82e837b0393155f7660931147e0d1..526b829bf676ae2e952cbcad78e3a21fe666817d 100644 (file)
@@ -17,7 +17,7 @@
 use rustc_session::parse::feature_err;
 use rustc_span::{sym, Span, Symbol};
 
-use crate::errors::ExprNotAllowedInContext;
+use crate::errors::{ExprNotAllowedInContext, SkippingConstChecks};
 
 /// An expression that is not *always* legal in a const context.
 #[derive(Clone, Copy)]
@@ -124,7 +124,7 @@ fn const_check_violated(&self, expr: NonConstExpr, span: Span) {
             // corresponding feature gate. This encourages nightly users to use feature gates when
             // possible.
             None if tcx.sess.opts.unstable_opts.unleash_the_miri_inside_of_you => {
-                tcx.sess.span_warn(span, "skipping const checks");
+                tcx.sess.emit_warning(SkippingConstChecks { span });
                 return;
             }