diff options
| author | Kivooeo <Kivooeo123@gmail.com> | 2025-07-01 23:33:59 +0500 |
|---|---|---|
| committer | Kivooeo <Kivooeo123@gmail.com> | 2025-07-01 23:33:59 +0500 |
| commit | 1fb5e0149fb85af0e49fa40329cbc352b4cba861 (patch) | |
| tree | 99717c06e20c4557a9e4d756a13bbf88d8093966 /tests/ui/reachable | |
| parent | f46ce66fcc3d6058f90ac5bf0930f940f1e7b0ca (diff) | |
| download | rust-1fb5e0149fb85af0e49fa40329cbc352b4cba861.tar.gz rust-1fb5e0149fb85af0e49fa40329cbc352b4cba861.zip | |
moved tests
Diffstat (limited to 'tests/ui/reachable')
| -rw-r--r-- | tests/ui/reachable/diverging-expressions-unreachable-code.rs | 19 | ||||
| -rw-r--r-- | tests/ui/reachable/unreachable-code-diverging-expressions.rs | 35 |
2 files changed, 54 insertions, 0 deletions
diff --git a/tests/ui/reachable/diverging-expressions-unreachable-code.rs b/tests/ui/reachable/diverging-expressions-unreachable-code.rs new file mode 100644 index 00000000000..9c5f7c8f451 --- /dev/null +++ b/tests/ui/reachable/diverging-expressions-unreachable-code.rs @@ -0,0 +1,19 @@ +//@ run-pass + +#![allow(unused_must_use)] +#![allow(unreachable_code)] + +#![allow(unused_variables)] +#![allow(dead_code)] + +fn id(x: bool) -> bool { x } + +fn call_id() { + let c = panic!(); + id(c); +} + +fn call_id_3() { id(return) && id(return); } + +pub fn main() { +} diff --git a/tests/ui/reachable/unreachable-code-diverging-expressions.rs b/tests/ui/reachable/unreachable-code-diverging-expressions.rs new file mode 100644 index 00000000000..0c46a38d73f --- /dev/null +++ b/tests/ui/reachable/unreachable-code-diverging-expressions.rs @@ -0,0 +1,35 @@ +//@ run-pass + +#![allow(unused_must_use)] +#![allow(dead_code)] +#![allow(path_statements)] +#![allow(unreachable_code)] +#![allow(unused_variables)] +#![feature(if_let_guard)] + +fn id(x: bool) -> bool { + x +} + +fn call_id() { + let c = panic!(); + id(c); +} + +fn call_id_2() { + id(true) && id(return); +} + +fn call_id_3() { + id(return) && id(return); +} + +fn ret_guard() { + match 2 { + x if (return) => { x; } + x if let true = return => { x; } + _ => {} + } +} + +pub fn main() {} |
