a-mir-formality
a-mir-formality copied to clipboard
associated type normalization syntax in surface rust differs from real rust
The rust layer permits things like
where
[(< T as Iterator[] > :: Item[] == u32)]
but this is not really what we support in regular Rust (T: Iterator<Item = u32>). There's been talk of adding == syntax to regular Rust (see https://github.com/rust-lang/rust/issues/20041) but it's not supported now. Meanwhile, the syntax we do support is more general, since one can do things like T: Foo<Bar = u32, Baz = i32>.
Also, in regular Rust, we lower T: Foo<Bar = u32> to both T: Foo and <T as Foo>::Bar = u32.