mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
23 lines
419 B
Rust
23 lines
419 B
Rust
trait Identity {
|
|
type Identity;
|
|
}
|
|
impl<T> Identity for T {
|
|
type Identity = T;
|
|
}
|
|
|
|
trait Trait {
|
|
type Assoc: Identity;
|
|
fn tokenize(&self) -> <Self::Assoc as Identity>::Identity;
|
|
}
|
|
|
|
impl Trait for () {
|
|
type Assoc = DoesNotExist;
|
|
//~^ ERROR cannot find type `DoesNotExist` in this scope
|
|
|
|
fn tokenize(&self) -> <Self::Assoc as Identity>::Identity {
|
|
unimplemented!()
|
|
}
|
|
}
|
|
|
|
fn main() {}
|