mirror of
https://github.com/rust-lang/rust
synced 2024-09-05 16:57:03 +00:00
26 lines
382 B
Rust
26 lines
382 B
Rust
//@ run-pass
|
|
// Test equality constraints on associated types inside of an object type
|
|
|
|
//@ pretty-expanded FIXME #23616
|
|
|
|
pub trait Foo {
|
|
type A;
|
|
fn boo(&self) -> <Self as Foo>::A;
|
|
}
|
|
|
|
pub struct Bar;
|
|
|
|
impl Foo for char {
|
|
type A = Bar;
|
|
fn boo(&self) -> Bar { Bar }
|
|
}
|
|
|
|
fn baz(x: &dyn Foo<A=Bar>) -> Bar {
|
|
x.boo()
|
|
}
|
|
|
|
pub fn main() {
|
|
let a = 'a';
|
|
baz(&a);
|
|
}
|