mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
19 lines
227 B
Rust
19 lines
227 B
Rust
//@ run-pass
|
|
//@ compile-flags: -g
|
|
|
|
use std::ops::Deref;
|
|
|
|
trait Foo {
|
|
fn foo() {}
|
|
}
|
|
|
|
impl Foo for u8 {}
|
|
|
|
fn bar<T: Deref>() where T::Target: Foo {
|
|
<<T as Deref>::Target as Foo>::foo()
|
|
}
|
|
|
|
fn main() {
|
|
bar::<&u8>();
|
|
}
|