Skip to content

Commit 45d00a1

Browse files
committed
Add test for unreachable_code with try operator
1 parent 49b19d3 commit 45d00a1

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//@ check-pass
2+
3+
#![forbid(unreachable_code)]
4+
5+
fn result() -> Result<(), ()> {
6+
Ok(())?;
7+
Err(())
8+
}
9+
10+
fn option() -> Option<()> {
11+
Some(())?;
12+
None
13+
}
14+
15+
fn main() {
16+
let _ = result();
17+
let _ = option();
18+
}

0 commit comments

Comments
 (0)