File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed
compiler/rustc_mir/src/transform Expand file tree Collapse file tree 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> {
692692 ) -> Result < ( ) , Unpromotable > {
693693 let fn_ty = callee. ty ( self . body , self . tcx ) ;
694694
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.
696696 // 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 {
703698 if let ty:: FnDef ( def_id, _) = * fn_ty. kind ( ) {
704699 // Never promote runtime `const fn` calls of
705700 // functions without `#[rustc_promotable]`.
You can’t perform that action at this time.
0 commit comments