File tree 2 files changed +15
-1
lines changed
compiler/rustc_middle/src/mir/interpret
2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,10 @@ impl<'tcx> TyCtxt<'tcx> {
95
95
// used generic parameters is a bug of evaluation, so checking for it
96
96
// here does feel somewhat sensible.
97
97
if !self . features ( ) . generic_const_exprs && ct. substs . has_non_region_param ( ) {
98
- assert ! ( matches!( self . def_kind( ct. def) , DefKind :: AnonConst ) ) ;
98
+ assert ! ( matches!(
99
+ self . def_kind( ct. def) ,
100
+ DefKind :: InlineConst | DefKind :: AnonConst
101
+ ) ) ;
99
102
let mir_body = self . mir_for_ctfe ( ct. def ) ;
100
103
if mir_body. is_polymorphic {
101
104
let Some ( local_def_id) = ct. def . as_local ( ) else { return } ;
Original file line number Diff line number Diff line change
1
+ // run-pass
2
+ #![ feature( inline_const_pat) ]
3
+ #![ allow( dead_code) ]
4
+ #![ allow( incomplete_features) ]
5
+ fn foo < const V : usize > ( ) {
6
+ match 0 {
7
+ const { 1 << 5 } | _ => { }
8
+ }
9
+ }
10
+
11
+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments