We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 383a5df commit a11f785Copy full SHA for a11f785
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."
982
// this doesn't come from a macro that has #[allow_internal_unstable]
983
!self.span.allows_unstable()
984
{
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 {
+ self.qualif = Qualif::NOT_CONST;
+ if self.mode != Mode::Fn {
992
// inside a constant environment, not having the feature gate is
993
// an error
994
let mut err = self.tcx.sess.struct_span_err(self.span,
0 commit comments