@@ -2968,12 +2968,33 @@ impl<'db> ExprCollector<'db> {
29682968 }
29692969
29702970 fn lower_ty_pat_range_side ( & mut self , pat : ast:: Pat ) -> ExprId {
2971+ let ptr = AstPtr :: new ( & pat) ;
29712972 match & pat {
29722973 ast:: Pat :: LiteralPat ( it) => {
29732974 let Some ( ( literal, _) ) = pat_literal_to_hir ( it) else { return self . missing_expr ( ) } ;
2974- self . alloc_expr_from_pat ( Expr :: Literal ( literal) , AstPtr :: new ( & pat) )
2975+ self . alloc_expr_from_pat ( Expr :: Literal ( literal) , ptr)
2976+ }
2977+ ast:: Pat :: ConstBlockPat ( it) => {
2978+ if let Some ( block) = it. block_expr ( ) {
2979+ let expr_id = self . with_label_rib ( RibKind :: Constant , |this| {
2980+ this. with_binding_owner ( |this| this. collect_block ( block) )
2981+ } ) ;
2982+ self . alloc_expr_from_pat ( Expr :: Const ( expr_id) , ptr)
2983+ } else {
2984+ self . missing_expr ( )
2985+ }
2986+ }
2987+ ast:: Pat :: PathPat ( it) => {
2988+ let path = it
2989+ . path ( )
2990+ . and_then ( |path| self . lower_path ( path, & mut Self :: impl_trait_error_allocator) ) ;
2991+ self . alloc_expr_from_pat ( path. map ( Expr :: Path ) . unwrap_or ( Expr :: Missing ) , ptr)
2992+ }
2993+ ast:: Pat :: IdentPat ( it) if it. is_simple_ident ( ) => {
2994+ let name = it. name ( ) . map ( |nr| nr. as_name ( ) ) . unwrap_or_else ( Name :: missing) ;
2995+ self . alloc_expr_from_pat ( Expr :: Path ( name. into ( ) ) , ptr)
29752996 }
2976- _ => self . missing_expr ( ) ,
2997+ _ => self . missing_expr ( ) , // FIXME: Emit an error.
29772998 }
29782999 }
29793000
0 commit comments