Skip to content

Commit

Permalink
Correctly mark things as min_const_fn
Browse files Browse the repository at this point in the history
  • Loading branch information
ecstatic-morse committed Dec 13, 2019
1 parent 0f0bfc9 commit faa52d1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/librustc_mir/transform/qualify_min_const_fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,10 +390,12 @@ fn check_terminator(
cleanup: _,
} => check_operand(tcx, cond, span, def_id, body),

TerminatorKind::FalseUnwind { .. } if !tcx.features().const_loop => {
Err((span, "loops are not allowed in const fn".into()))
},
| TerminatorKind::FalseUnwind { .. }
if feature_allowed(tcx, def_id, sym::const_loop)
=> Ok(()),

TerminatorKind::FalseUnwind { .. } => Ok(()),
TerminatorKind::FalseUnwind { .. } => {
Err((span, "loops are not allowed in const fn".into()))
}
}
}

0 comments on commit faa52d1

Please sign in to comment.