2023-08-17 01:24:56 +00:00
|
|
|
#![allow(dead_code, unreachable_code)]
|
|
|
|
|
2022-01-21 01:23:27 +00: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.
|
|
|
|
|
|
|
|
// compile-flags: --edition=2021
|
|
|
|
|
2023-08-17 01:43:10 +00:00
|
|
|
enum Never {}
|
2022-01-21 01:23:27 +00:00
|
|
|
|
|
|
|
impl Never {
|
|
|
|
fn foo(self) {
|
2023-08-17 01:43:10 +00:00
|
|
|
match self {}
|
|
|
|
make().map(|never| match never {});
|
2022-01-21 01:23:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn bar(&self) {
|
2023-08-17 01:43:10 +00:00
|
|
|
match *self {}
|
2022-01-21 01:23:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
async fn foo2(never: Never) {
|
2023-08-17 01:43:10 +00:00
|
|
|
match never {}
|
2022-01-21 01:23:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn make() -> Option<Never> {
|
|
|
|
None
|
|
|
|
}
|
|
|
|
|
2023-08-17 01:43:10 +00:00
|
|
|
fn main() {}
|