rust/tests/ui/inference/inference-thread-loop-closure.rs
2025-12-13 00:54:20 +09:00

16 lines
294 B
Rust

//! regression test for <https://github.com/rust-lang/rust/issues/20454>
//@ check-pass
#![allow(unused_must_use)]
use std::thread;
fn _foo() {
thread::spawn(move || {
// no need for -> ()
loop {
println!("hello");
}
})
.join();
}
fn main() {}