Skip to content

Commit fc97ce6

Browse files
committed
add tests for new behavior
1 parent e4ce655 commit fc97ce6

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

src/test/ui/match/issue-82392.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// https://github.com/rust-lang/rust/issues/82329
2+
// compile-flags: -Zunpretty=hir,typed
3+
// check-pass
4+
5+
pub fn main() {
6+
if true {
7+
} else if let Some(a) = Some(3) {
8+
}
9+
}

src/test/ui/match/issue-82392.stdout

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#[prelude_import]
2+
use ::std::prelude::rust_2015::*;
3+
#[macro_use]
4+
extern crate std;
5+
// https://github.com/rust-lang/rust/issues/82329
6+
// compile-flags: -Zunpretty=hir,typed
7+
// check-pass
8+
9+
pub fn main() ({
10+
(if (true as bool)
11+
({ } as
12+
()) else {match ((Some as
13+
fn(i32) -> Option<i32> {Option::<i32>::Some})((3
14+
as
15+
i32))
16+
as Option<i32>) {
17+
Some(a) => { }
18+
_ => { }
19+
}} as ())
20+
} as ())

src/test/ui/match/issue-84434.rs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// https://github.com/rust-lang/rust/issues/84434
2+
// check-pass
3+
4+
use std::path::Path;
5+
struct A {
6+
pub func: fn(check: bool, a: &Path, b: Option<&Path>),
7+
}
8+
const MY_A: A = A {
9+
func: |check, a, b| {
10+
if check {
11+
let _ = ();
12+
} else if let Some(parent) = b.and_then(|p| p.parent()) {
13+
let _ = ();
14+
}
15+
},
16+
};
17+
18+
fn main() {}

0 commit comments

Comments
 (0)