From a11f7856f41f4231198b18d65e2889bae859b8f7 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Sun, 20 May 2018 23:18:41 +0200 Subject: [PATCH] Always mark unstable const fn as not const --- src/librustc_mir/transform/qualify_consts.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/librustc_mir/transform/qualify_consts.rs b/src/librustc_mir/transform/qualify_consts.rs index 83c0d257999..c249dc312f2 100644 --- a/src/librustc_mir/transform/qualify_consts.rs +++ b/src/librustc_mir/transform/qualify_consts.rs @@ -982,13 +982,8 @@ This does not pose a problem by itself because they can't be accessed directly." // this doesn't come from a macro that has #[allow_internal_unstable] !self.span.allows_unstable() { - if self.mode == Mode::Fn { - // We are in a normal function - // with a turned off feature gate. We can still call the function - // but we can't promote it - self.qualif = Qualif::NOT_CONST; - debug!("unstable const fn"); - } else { + self.qualif = Qualif::NOT_CONST; + if self.mode != Mode::Fn { // inside a constant environment, not having the feature gate is // an error let mut err = self.tcx.sess.struct_span_err(self.span,