Merge pull request #375 from yvt/patch/fix-never-type-mismatch

graphics-server: convert "never" types in `backend::betrusted::claim_main_thread`
This commit is contained in:
bunnie 2023-04-28 00:30:08 +08:00 committed by GitHub
commit 88a7f016be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,7 +17,8 @@ pub enum Never {}
#[inline]
pub fn claim_main_thread(f: impl FnOnce(MainThreadToken) -> Never + Send + 'static) -> ! {
// Just call the closure - this backend will work on any thread
f(MainThreadToken(()))
#[allow(unreachable_code)] // false positive
match f(MainThreadToken(())) {}
}
pub struct XousDisplay {