File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/librustc_mir/transform/check_consts Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,11 @@ impl ConstKind {
77
77
let mode = match tcx. hir ( ) . body_owner_kind ( hir_id) {
78
78
HirKind :: Closure => return None ,
79
79
80
- HirKind :: Fn if tcx. is_const_fn ( def_id) => ConstKind :: ConstFn ,
80
+ // Note: this is deliberately checking for `is_const_fn_raw`, as the `is_const_fn`
81
+ // checks take into account the `rustc_const_unstable` attribute combined with enabled
82
+ // feature gates. An unstable `const fn` could otherwise be considered "not const"
83
+ // by const qualification. See issue #67053 for more details.
84
+ HirKind :: Fn if tcx. is_const_fn_raw ( def_id) => ConstKind :: ConstFn ,
81
85
HirKind :: Fn => return None ,
82
86
83
87
HirKind :: Const => ConstKind :: Const ,
You can’t perform that action at this time.
0 commit comments