rust/tests/ui/traits/issue-33096.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
227 B
Rust
Raw Normal View History

//@ 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>();
}