File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed 
compiler/rustc_hir_pretty/src Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -911,6 +911,10 @@ impl<'a> State<'a> {
911911        if  let  Some ( els)  = els { 
912912            self . nbsp ( ) ; 
913913            self . word_space ( "else" ) ; 
914+             // containing cbox, will be closed by print-block at `}` 
915+             self . cbox ( 0 ) ; 
916+             // head-box, will be closed by print-block after `{` 
917+             self . ibox ( 0 ) ; 
914918            self . print_block ( els) ; 
915919        } 
916920
Original file line number Diff line number Diff line change 1+ // compile-flags: -Zunpretty=hir 
2+ // check-pass 
3+ 
4+ #![ feature( let_else) ]  
5+ 
6+ fn  foo ( x :  Option < u32 > )  { 
7+     let  Some ( _)  = x else  {  panic ! ( )  } ; 
8+ } 
9+ 
10+ fn  main ( )  { } 
Original file line number Diff line number Diff line change 1+ // compile-flags: -Zunpretty=hir
2+ // check-pass
3+ 
4+ #![feature(let_else)]
5+ #[prelude_import]
6+ use ::std::prelude::rust_2015::*;
7+ #[macro_use]
8+ extern crate std;
9+ 
10+ fn foo(x:
11+         Option<u32>) {
12+         let Some(_) = x else
13+             {
14+ 
15+             { ::std::rt::begin_panic("explicit panic") }
16+         };
17+     }
18+ fn main() { }
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments