2023-08-16 20:24:56 -05:00
|
|
|
#![allow(dead_code, unreachable_code)]
|
2024-01-12 00:12:45 -06:00
|
|
|
//@ edition: 2021
|
2023-08-16 20:24:56 -05:00
|
|
|
|
2022-01-20 19:23:27 -06:00
|
|
|
// Regression test for #93054: Functions using uninhabited types often only have a single,
|
|
|
|
// unreachable basic block which doesn't get instrumented. This should not cause llvm-cov to fail.
|
|
|
|
// Since these kinds functions can't be invoked anyway, it's ok to not have coverage data for them.
|
|
|
|
|
2023-08-16 20:43:10 -05:00
|
|
|
enum Never {}
|
2022-01-20 19:23:27 -06:00
|
|
|
|
|
|
|
impl Never {
|
|
|
|
fn foo(self) {
|
2023-08-16 20:43:10 -05:00
|
|
|
match self {}
|
|
|
|
make().map(|never| match never {});
|
2022-01-20 19:23:27 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn bar(&self) {
|
2023-08-16 20:43:10 -05:00
|
|
|
match *self {}
|
2022-01-20 19:23:27 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
async fn foo2(never: Never) {
|
2023-08-16 20:43:10 -05:00
|
|
|
match never {}
|
2022-01-20 19:23:27 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn make() -> Option<Never> {
|
|
|
|
None
|
|
|
|
}
|
|
|
|
|
2023-08-16 20:43:10 -05:00
|
|
|
fn main() {}
|