File tree Expand file tree Collapse file tree 2 files changed +18
-9
lines changed Expand file tree Collapse file tree 2 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -2048,15 +2048,14 @@ impl<'a> LoweringContext<'a> {
2048
2048
2049
2049
// _ => [<else_opt>|()]
2050
2050
{
2051
- let wildcard_arm: Option < & Expr > = else_opt. as_ref ( ) . map ( |p| & * * p) ;
2052
- let wildcard_pattern = self . pat_wild ( e. span ) ;
2053
- let body =
2054
- if let Some ( else_expr) = wildcard_arm {
2055
- P ( self . lower_expr ( else_expr) )
2056
- } else {
2057
- self . expr_tuple ( e. span , hir_vec ! [ ] )
2058
- } ;
2059
- arms. push ( self . arm ( hir_vec ! [ wildcard_pattern] , body) ) ;
2051
+ let wildcard_arm: Option < & Expr > = else_opt. as_ref ( ) . map ( |p| & * * p) ;
2052
+ let wildcard_pattern = self . pat_wild ( e. span ) ;
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
+ } ;
2058
+ arms. push ( self . arm ( hir_vec ! [ wildcard_pattern] , body) ) ;
2060
2059
}
2061
2060
2062
2061
let contains_else_clause = else_opt. is_some ( ) ;
Original file line number Diff line number Diff line change
1
+ // Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
1
11
struct Foo ;
2
12
3
13
impl Foo {
You can’t perform that action at this time.
0 commit comments