forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#100434 - compiler-errors:issue-100373, r=cj…
…gillot Fix HIR pretty printing of let else Fixes rust-lang#100373 Fixes rust-lang#99318 Fixes rust-lang#99319
- Loading branch information
Showing
3 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// compile-flags: -Zunpretty=hir | ||
// check-pass | ||
|
||
#![feature(let_else)] | ||
|
||
fn foo(x: Option<u32>) { | ||
let Some(_) = x else { panic!() }; | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// compile-flags: -Zunpretty=hir | ||
// check-pass | ||
|
||
#![feature(let_else)] | ||
#[prelude_import] | ||
use ::std::prelude::rust_2015::*; | ||
#[macro_use] | ||
extern crate std; | ||
|
||
fn foo(x: | ||
Option<u32>) { | ||
let Some(_) = x else | ||
{ | ||
|
||
{ ::std::rt::begin_panic("explicit panic") } | ||
}; | ||
} | ||
fn main() { } |