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.
- Loading branch information
Showing
3 changed files
with
47 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// https://github.com/rust-lang/rust/issues/82329 | ||
// compile-flags: -Zunpretty=hir,typed | ||
// check-pass | ||
|
||
pub fn main() { | ||
if true { | ||
} else if let Some(a) = Some(3) { | ||
} | ||
} |
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,20 @@ | ||
#[prelude_import] | ||
use ::std::prelude::rust_2015::*; | ||
#[macro_use] | ||
extern crate std; | ||
// https://github.com/rust-lang/rust/issues/82329 | ||
// compile-flags: -Zunpretty=hir,typed | ||
// check-pass | ||
|
||
pub fn main() ({ | ||
(if (true as bool) | ||
({ } as | ||
()) else {match ((Some as | ||
fn(i32) -> Option<i32> {Option::<i32>::Some})((3 | ||
as | ||
i32)) | ||
as Option<i32>) { | ||
Some(a) => { } | ||
_ => { } | ||
}} as ()) | ||
} as ()) |
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 @@ | ||
// https://github.com/rust-lang/rust/issues/84434 | ||
// check-pass | ||
|
||
use std::path::Path; | ||
struct A { | ||
pub func: fn(check: bool, a: &Path, b: Option<&Path>), | ||
} | ||
const MY_A: A = A { | ||
func: |check, a, b| { | ||
if check { | ||
let _ = (); | ||
} else if let Some(parent) = b.and_then(|p| p.parent()) { | ||
let _ = (); | ||
} | ||
}, | ||
}; | ||
|
||
fn main() {} |