File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -2051,10 +2051,10 @@ impl<'a> LoweringContext<'a> {
2051
2051
let wildcard_arm: Option < & Expr > = else_opt. as_ref ( ) . map ( |p| & * * p) ;
2052
2052
let wildcard_pattern = self . pat_wild ( e. span ) ;
2053
2053
let body = if let Some ( else_expr) = wildcard_arm {
2054
- P ( self . lower_expr ( else_expr) )
2055
- } else {
2056
- self . expr_tuple ( e. span , hir_vec ! [ ] )
2057
- } ;
2054
+ P ( self . lower_expr ( else_expr) )
2055
+ } else {
2056
+ self . expr_tuple ( e. span , hir_vec ! [ ] )
2057
+ } ;
2058
2058
arms. push ( self . arm ( hir_vec ! [ wildcard_pattern] , body) ) ;
2059
2059
}
2060
2060
Original file line number Diff line number Diff line change @@ -14,10 +14,16 @@ impl Foo {
14
14
fn bar ( & mut self ) -> bool { true }
15
15
}
16
16
17
- /* This causes E0301. By fixing issue #41272 this problem should vanish */
18
- fn iflet_issue ( foo : & mut Foo ) {
17
+ fn error ( foo : & mut Foo ) {
19
18
if let Some ( _) = Some ( true ) {
20
19
} else if foo. bar ( ) { }
21
20
}
22
21
22
+ fn ok ( foo : & mut Foo ) {
23
+ if let Some ( _) = Some ( true ) {
24
+ } else {
25
+ if foo. bar ( ) { }
26
+ }
27
+ }
28
+
23
29
fn main ( ) { }
You can’t perform that action at this time.
0 commit comments