Generalizing with GAT: what's going to happen to the current, less general traits?

This page summarizes the projects mentioned and recommended in the original post on /r/rust

Our great sponsors
  • WorkOS - The modern API for authentication & user identity.
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • LearnThisRepo.com - Learn 300+ open source libraries for free using AI.
  • rust

    Empowering everyone to build reliable and efficient software.

    This is a tough question. AFAIK, there aren't any plans for GATs in std, other than one feature request issue filed for generators (https://github.com/rust-lang/rust/issues/69268). I think it'd be super neat to be able to add lifetime parameters to some existing traits in std, but I'm not sure this is able to be done in a backwards compatible way (though, I'd be super interested to hear thoughts here). As for new traits, like I said, I haven't heard anything.

  • go

    The Go programming language

    Somewhat anecdotally, I think it's worth taking the same approach as Go is with the introduction of generics and avoid making changes to std until we've seen how the broader Rust ecosystem ends up using the feature. That linked issue has some great discussion from Rob Pike on that point, but it basically boils down to the fact that we still don't know what the best practices and design patterns that work around GAT will turn out to be. So we shouldn't lock ourselves into potentially poor decisions early on in std that we'll have to live with forever.

  • WorkOS

    The modern API for authentication & user identity. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts