You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following code rust analyzer automatically deletes code (the generic args on the associated type in the type constraint) that is necessary for the code to compile. This happens in the VS code extension.
#![feature(generic_associated_types)]
trait Trait {
type Assoc<'a>;
}
// this requires a constraint on the associated type (Assoc<'a> = ()), but rust analyzer always automatically deletes the generic args on the associated type
fn f<'a, T: Trait<Assoc = ()>>(_: T, _: impl Fn(T::Assoc<'a>) -> T::Assoc<'a>) -> T::Assoc<'a> {}
struct Type;
impl Trait for Type {
type Assoc<'a> = ();
}
fn main() {
f(Type, |_| ());
}
The text was updated successfully, but these errors were encountered:
In the following code rust analyzer automatically deletes code (the generic args on the associated type in the type constraint) that is necessary for the code to compile. This happens in the VS code extension.
The text was updated successfully, but these errors were encountered: