- async closure Output deduction, solver cycle step kinds from the goal source, object supertrait projections, impl candidate merging, trait supertrait well-formedness, E0282 for casts and method calls on diverging variables, the (..) tuple pattern Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
15 lines
510 B
Rust
15 lines
510 B
Rust
// An async block whose body only diverges has a return type variable that falls back
|
|
// like any variable a `!` flowed into (it used to report E0282).
|
|
use std::future::Future;
|
|
|
|
fn block_on_never<F: Future>(_f: F) -> F::Output { loop {} }
|
|
|
|
#[allow(dead_code, unreachable_code)]
|
|
fn never_bodies() {
|
|
let _a = async move { unimplemented!() };
|
|
let _b = || async move { unimplemented!() };
|
|
let _c = block_on_never(async move { (move || async move { unimplemented!() })() });
|
|
}
|
|
|
|
#[test]
|
|
fn compiles() {}
|