Skip to content

Commit a11f785

Browse files
committed
Always mark unstable const fn as not const
1 parent 383a5df commit a11f785

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
@@ -982,13 +982,8 @@ This does not pose a problem by itself because they can't be accessed directly."
982982
// this doesn't come from a macro that has #[allow_internal_unstable]
983983
!self.span.allows_unstable()
984984
{
985-
if self.mode == Mode::Fn {
986-
// We are in a normal function
987-
// with a turned off feature gate. We can still call the function
988-
// but we can't promote it
989-
self.qualif = Qualif::NOT_CONST;
990-
debug!("unstable const fn");
991-
} else {
985+
self.qualif = Qualif::NOT_CONST;
986+
if self.mode != Mode::Fn {
992987
// inside a constant environment, not having the feature gate is
993988
// an error
994989
let mut err = self.tcx.sess.struct_span_err(self.span,

0 commit comments

Comments
 (0)