cleanup false positive warnings in latest rustc

This commit is contained in:
bunnie 2026-01-06 13:41:54 +08:00
parent 08cfe2d724
commit cabfbde7f2
2 changed files with 2 additions and 0 deletions

View file

@ -146,6 +146,7 @@ fn handle_irq(_irq_no: usize, arg: *mut usize) {
fn main() -> ! {
let stack_size = 2 * 1024 * 1024;
#[allow(unreachable_code)] // false positive
claim_main_thread(move |main_thread_token| {
std::thread::Builder::new()
.stack_size(stack_size)

View file

@ -55,6 +55,7 @@ pub fn claim_main_thread(f: impl FnOnce(MainThreadToken) -> Never + Send + 'stat
let (send, recv) = mpsc::sync_channel(0);
// Call the closure on a fake main thread
#[allow(unreachable_code)] // false positive
let fake_main_thread = std::thread::Builder::new()
.name("wrapped_main".into())
.spawn(move || f(MainThreadToken(send)))