This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
compiler/rustc_mir/src/transform/check_consts Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,11 @@ pub fn is_lang_panic_fn(tcx: TyCtxt<'tcx>, def_id: DefId) -> bool {
7777 Some ( def_id) == tcx. lang_items ( ) . panic_fn ( ) || Some ( def_id) == tcx. lang_items ( ) . begin_panic_fn ( )
7878}
7979
80- pub fn allow_internal_unstable ( tcx : TyCtxt < ' tcx > , def_id : DefId , feature_gate : Symbol ) -> bool {
80+ pub fn rustc_allow_const_fn_unstable (
81+ tcx : TyCtxt < ' tcx > ,
82+ def_id : DefId ,
83+ feature_gate : Symbol ,
84+ ) -> bool {
8185 let attrs = tcx. get_attrs ( def_id) ;
8286 attr:: rustc_allow_const_fn_unstable ( & tcx. sess , attrs)
8387 . map_or ( false , |mut features| features. any ( |name| name == feature_gate) )
Original file line number Diff line number Diff line change @@ -292,7 +292,11 @@ impl Validator<'mir, 'tcx> {
292292
293293 Status :: Unstable ( gate) if self . tcx . features ( ) . enabled ( gate) => {
294294 let unstable_in_stable = self . ccx . is_const_stable_const_fn ( )
295- && !super :: allow_internal_unstable ( self . tcx , self . def_id ( ) . to_def_id ( ) , gate) ;
295+ && !super :: rustc_allow_const_fn_unstable (
296+ self . tcx ,
297+ self . def_id ( ) . to_def_id ( ) ,
298+ gate,
299+ ) ;
296300 if unstable_in_stable {
297301 emit_unstable_in_stable_error ( self . ccx , span, gate) ;
298302 }
@@ -819,7 +823,7 @@ impl Visitor<'tcx> for Validator<'mir, 'tcx> {
819823
820824 // Otherwise, we are something const-stable calling a const-unstable fn.
821825
822- if super :: allow_internal_unstable ( tcx, caller, gate) {
826+ if super :: rustc_allow_const_fn_unstable ( tcx, caller, gate) {
823827 return ;
824828 }
825829
You can’t perform that action at this time.
0 commit comments