Skip to content

Commit 329fd90

Browse files
committed
Always mark unstable const fn as not const
1 parent 0a94f78 commit 329fd90

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/librustc_mir/transform/qualify_consts.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -972,13 +972,8 @@ This does not pose a problem by itself because they can't be accessed directly."
972972
// this doesn't come from a macro that has #[allow_internal_unstable]
973973
!self.span.allows_unstable()
974974
{
975-
if self.mode == Mode::Fn {
976-
// We are in a normal function
977-
// with a turned off feature gate. We can still call the function
978-
// but we can't promote it
979-
self.qualif = Qualif::NOT_CONST;
980-
debug!("unstable const fn");
981-
} else {
975+
self.qualif = Qualif::NOT_CONST;
976+
if self.mode != Mode::Fn {
982977
// inside a constant environment, not having the feature gate is
983978
// an error
984979
let mut err = self.tcx.sess.struct_span_err(self.span,

0 commit comments

Comments
 (0)