File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1364,10 +1364,14 @@ impl<'ctx> MirLowerCtx<'ctx> {
1364
1364
match loc {
1365
1365
LiteralOrConst :: Literal ( l) => self . lower_literal_to_operand ( ty, l) ,
1366
1366
LiteralOrConst :: Const ( c) => {
1367
- let unresolved_name = || MirLowerError :: unresolved_path ( self . db , c) ;
1367
+ let c = match & self . body . pats [ * c] {
1368
+ Pat :: Path ( p) => p,
1369
+ _ => not_supported ! ( "only `char` and numeric types are allowed in range patterns" ) ,
1370
+ } ;
1371
+ let unresolved_name = || MirLowerError :: unresolved_path ( self . db , c. as_ref ( ) ) ;
1368
1372
let resolver = self . owner . resolver ( self . db . upcast ( ) ) ;
1369
1373
let pr = resolver
1370
- . resolve_path_in_value_ns ( self . db . upcast ( ) , c)
1374
+ . resolve_path_in_value_ns ( self . db . upcast ( ) , c. as_ref ( ) )
1371
1375
. ok_or_else ( unresolved_name) ?;
1372
1376
match pr {
1373
1377
ResolveValueResult :: ValueNs ( v, _) => {
You can’t perform that action at this time.
0 commit comments