Skip to content

Commit

Permalink
Always mark unstable const fn as not const
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed May 20, 2018
1 parent 0a94f78 commit 329fd90
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/librustc_mir/transform/qualify_consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -972,13 +972,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,
Expand Down

0 comments on commit 329fd90

Please sign in to comment.