Skip to content
TILens What matters today in tech v0.4.0
Theme

Topic - Edition

Rust news

1 items on 20 Jul 2026
Rust

Two-way vs. one-way unification when resolving traits

I'm trying to understand how trait resolving in the code below works: enum Wrap<T> { W, WithVal(T), } struct Alt; trait Two<B> {} impl<T> Two<T> for Wrap<T> {} fn f<P, Q>(p: P, q: Q) where P: Two<Q> {} fn main() {…

Source: Rust Internals Forum osa1