File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -334,7 +334,11 @@ impl InferenceContext<'_> {
334
334
ExprIsRead :: No
335
335
} ;
336
336
let input_ty = self . infer_expr ( expr, & Expectation :: none ( ) , child_is_read) ;
337
- self . infer_top_pat ( pat, & input_ty, None ) ;
337
+ self . infer_top_pat (
338
+ pat,
339
+ & input_ty,
340
+ Some ( DeclContext { origin : DeclOrigin :: LetExpr } ) ,
341
+ ) ;
338
342
self . result . standard_types . bool_ . clone ( )
339
343
}
340
344
Expr :: Block { statements, tail, label, id } => {
Original file line number Diff line number Diff line change @@ -1052,8 +1052,11 @@ pub fn known_const_to_ast(
1052
1052
1053
1053
#[ derive( Debug , Copy , Clone ) ]
1054
1054
pub ( crate ) enum DeclOrigin {
1055
+ LetExpr ,
1055
1056
/// from `let x = ..`
1056
- LocalDecl { has_else : bool } ,
1057
+ LocalDecl {
1058
+ has_else : bool ,
1059
+ } ,
1057
1060
}
1058
1061
1059
1062
/// Provides context for checking patterns in declarations. More specifically this
You can’t perform that action at this time.
0 commit comments