Rust decltype progress

Hi,

Is there any progress on Rust equivalent of decltype? It seems that using traits or structs with futures is currently impossible without either:

  • Implementing future by hand and using unsafe (error prone and has boilerplate)
  • Using dyn Future and boxing it (pays performance penalty)

I think you're looking for

1 Like

there are cases where it'd be very handy to name the type of a value, e.g. for writing macros that just have the value passed in, but not the type. Something like:

macro_rules! m {
    ($v:expr) => {
        <typeof($v)>::AssociatedType::f($v)
    };
}
5 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.