fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.0 KiB31 linesraw
1   LL|       |#![allow(dead_code, unreachable_code)]
2   LL|       |
3   LL|       |// Regression test for #93054: Functions using uninhabited types often only have a single,
4   LL|       |// unreachable basic block which doesn't get instrumented. This should not cause llvm-cov to fail.
5   LL|       |// Since these kinds functions can't be invoked anyway, it's ok to not have coverage data for them.
6   LL|       |
7   LL|       |// compile-flags: --edition=2021
8   LL|       |
9   LL|       |enum Never {}
10   LL|       |
11   LL|       |impl Never {
12   LL|       |    fn foo(self) {
13   LL|       |        match self {}
14   LL|       |        make().map(|never| match never {});
15   LL|       |    }
16   LL|       |
17   LL|       |    fn bar(&self) {
18   LL|       |        match *self {}
19   LL|       |    }
20   LL|       |}
21   LL|       |
22   LL|      0|async fn foo2(never: Never) {
23   LL|       |    match never {}
24   LL|       |}
25   LL|       |
26   LL|      0|fn make() -> Option<Never> {
27   LL|      0|    None
28   LL|      0|}
29   LL|       |
30   LL|      1|fn main() {}
31