File tree 2 files changed +11
-3
lines changed
compiler/rustc_mir/src/transform/check_consts
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 {
77
77
Some ( def_id) == tcx. lang_items ( ) . panic_fn ( ) || Some ( def_id) == tcx. lang_items ( ) . begin_panic_fn ( )
78
78
}
79
79
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 {
81
85
let attrs = tcx. get_attrs ( def_id) ;
82
86
attr:: rustc_allow_const_fn_unstable ( & tcx. sess , attrs)
83
87
. 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> {
292
292
293
293
Status :: Unstable ( gate) if self . tcx . features ( ) . enabled ( gate) => {
294
294
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
+ ) ;
296
300
if unstable_in_stable {
297
301
emit_unstable_in_stable_error ( self . ccx , span, gate) ;
298
302
}
@@ -819,7 +823,7 @@ impl Visitor<'tcx> for Validator<'mir, 'tcx> {
819
823
820
824
// Otherwise, we are something const-stable calling a const-unstable fn.
821
825
822
- if super :: allow_internal_unstable ( tcx, caller, gate) {
826
+ if super :: rustc_allow_const_fn_unstable ( tcx, caller, gate) {
823
827
return ;
824
828
}
825
829
You can’t perform that action at this time.
0 commit comments