There are some subtle behaviors around where generic arguments can appear in a path, particularly with enum variants. For example:
enum E<T> {
V1 { x: T },
}
fn main() {
// These seem to be the same.
E::V1::<i32> { x: 1 };
E::<i32>::V1 { x: 1 };
}
Are these exactly the same? I'm wondering if there are other oddities like this? This came up when looking at rust-lang/rust#154971.
#2165 is adding more documentation on generic arguments and how they are associated, but I don't think it covers this.
There are some subtle behaviors around where generic arguments can appear in a path, particularly with enum variants. For example:
Are these exactly the same? I'm wondering if there are other oddities like this? This came up when looking at rust-lang/rust#154971.
#2165 is adding more documentation on generic arguments and how they are associated, but I don't think it covers this.