Rust: Reimplement type inference for impl Traits and await expressions

This commit is contained in:
Tom Hvitved
2025-06-02 12:58:51 +02:00
parent f2832712bc
commit c6efc05de1
9 changed files with 327 additions and 162 deletions

View File

@@ -0,0 +1,7 @@
use std::future::Future;
fn await_type_matching<T1, T2: Future<Output = T1>>(x: T2) -> T1 {
panic!(
"This function exists only in order to implement type inference for `.await` expressions."
);
}