-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-trait-systemArea: Trait systemArea: Trait system
Description
[Previously reported on rust-dev]
I'm trying to say "Any type that implements Foo<X1>
also implements Foo<X2>
":
trait Foo<T> {}
struct X1;
struct X2;
impl<T: Foo<X1>> Foo<X2> for T {}
fn main() {}
but this does not compile:
test.rs:5:1: 5:34 error: expected Foo<X2>, but found Foo<X1> (expected struct X2 but found struct X1)
test.rs:5 impl<T: Foo<X1>> Foo<X2> for T {}
This is supposedly related to Rust not distinguishing between different instantiations of generic traits, though you'd never guess that from the error message...
Metadata
Metadata
Assignees
Labels
A-trait-systemArea: Trait systemArea: Trait system