]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/precise-drop-with-coverage.rs
Rollup merge of #107004 - compiler-errors:new-solver-new-candidates-2, r=lcnr
[rust.git] / tests / ui / consts / precise-drop-with-coverage.rs
1 // Checks that code coverage doesn't interfere with const_precise_live_drops.
2 // Regression test for issue #93848.
3 //
4 // check-pass
5 // compile-flags: --crate-type=lib -Cinstrument-coverage  -Zno-profiler-runtime
6
7 #![feature(const_precise_live_drops)]
8
9 #[inline]
10 pub const fn transpose<T, E>(this: Option<Result<T, E>>) -> Result<Option<T>, E> {
11     match this {
12         Some(Ok(x)) => Ok(Some(x)),
13         Some(Err(e)) => Err(e),
14         None => Ok(None),
15     }
16 }