File tree 1 file changed +2
-7
lines changed
compiler/rustc_mir/src/transform
1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -692,14 +692,9 @@ impl<'tcx> Validator<'_, 'tcx> {
692
692
) -> Result < ( ) , Unpromotable > {
693
693
let fn_ty = callee. ty ( self . body , self . tcx ) ;
694
694
695
- // When doing explicit promotion and inside const/static items , we promote all (eligible) function calls.
695
+ // When doing explicit promotion, we promote all (eligible) function calls.
696
696
// Everywhere else, we require `#[rustc_promotable]` on the callee.
697
- let promote_all_const_fn = self . explicit
698
- || matches ! (
699
- self . const_kind,
700
- Some ( hir:: ConstContext :: Static ( _) | hir:: ConstContext :: Const )
701
- ) ;
702
- if !promote_all_const_fn {
697
+ if !self . explicit {
703
698
if let ty:: FnDef ( def_id, _) = * fn_ty. kind ( ) {
704
699
// Never promote runtime `const fn` calls of
705
700
// functions without `#[rustc_promotable]`.
You can’t perform that action at this time.
0 commit comments