Closed
Description
Associated type syntax has changed so the where clause comes after the assignment instead of before:
- Proposal: Change syntax of where clauses on type aliases rust#89122
- Change location of where clause on GATs rust#90076
Minimized example code:
pub trait Trait {
type AssociatedType where Self: Clone;
}
impl Trait for () {
type AssociatedType = () where Self: Clone;
}
Result:
Syntax Error: expected SEMICOLON
Syntax Error: expected an item
Syntax Error: expected BANG
Syntax Error: expected `{`, `[`, `(`
Syntax Error: expected SEMICOLON
Syntax Error: expected an item
Syntax Error: expected BANG
Syntax Error: expected `{`, `[`, `(`
rust-analyzer version:
5fae65dd2 2022-03-07 stable
5fae65dd2 2022-03-07 nightly
rustc version: rustc 1.61.0-nightly (38a0b81b1 2022-03-06)
relevant settings: N/A