a-mir-formality icon indicating copy to clipboard operation
a-mir-formality copied to clipboard

associated type normalization syntax in surface rust differs from real rust

Open nikomatsakis opened this issue 3 years ago • 0 comments

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.

nikomatsakis avatar Jul 09 '22 10:07 nikomatsakis