I made a library for naming async fn return types on stable Rust (w/o boxing or dyn)

Hi! I found a way to imitate subset of TAITs on stable Rust.

Repository / Crates.io / Docs.rs

Usage looks like this:

#[name_it(Test)]
async fn add(x: i32, y: i32) -> i32 {
    do_something_very_async().await;
    x + y
}

let foo: Test = add(2, 3);
assert_eq!(block_on(foo), 5);

It’s currently quite limited and to be considered in alpha stage until I get more feedback about soundness, but I’d like to show off that it could be done and invite reviews and/or contributions.

3 Likes