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> {
13641364 match loc {
13651365 LiteralOrConst :: Literal ( l) => self . lower_literal_to_operand ( ty, l) ,
13661366 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 ( ) ) ;
13681372 let resolver = self . owner . resolver ( self . db . upcast ( ) ) ;
13691373 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 ( ) )
13711375 . ok_or_else ( unresolved_name) ?;
13721376 match pr {
13731377 ResolveValueResult :: ValueNs ( v, _) => {
You can’t perform that action at this time.
0 commit comments