Closed daprilik closed 1 year ago
There has never been a stable Rust release in which where-clause before type in an impl block was accepted -- it went from unstable in 1.64.0:
error[E0658]: generic associated types are unstable
--> src/main.rs:10:5
|
10 | / type Assoc<'a>
11 | | where
12 | | Self: 'a,
13 | | = T::Assoc<'a>;
| |___________________^
|
= note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information
to "not allowed" in 1.65.0 and all subsequent releases:
warning: where clause not allowed here
--> src/main.rs:11:5
|
11 | / where
12 | | Self: 'a,
| |_________________^
|
= note: `#[warn(deprecated_where_clause_location)]` on by default
= note: see issue #89122 <https://github.com/rust-lang/rust/issues/89122> for more information
help: move it to the end of the type declaration
|
11 ~
12 ~ = T::Assoc<'a> where Self: 'a;
|
Maybe something about macro expansion concealed this? In any case I think it's fine not to parse this code.
Seems something slipped through the cracks during the port to syn 2?
I've got it down to a minimal repro that would compile fine on
0.1.66
and earlier, but doesn't anymore:It's throwing a
Note that the following impl does compile:
I'll be switching to the latter as a workaround, but it seems spooky for code to stop compiling.