Files
rust/tests/ui/traits/trait-implementation-restriction-5988.rs

25 lines
251 B
Rust
Raw Normal View History

2025-08-20 14:02:39 -04:00
// https://github.com/rust-lang/rust/issues/5988
//@ run-pass
2014-12-07 15:22:06 +00:00
trait B {
fn f(&self);
}
trait T : B {
}
struct A;
impl<U: T> B for U {
2015-04-10 11:12:43 -07:00
fn f(&self) { }
2014-12-07 15:22:06 +00:00
}
impl T for A {
}
fn main() {
let a = A;
2019-05-28 14:47:21 -04:00
let br = &a as &dyn B;
2014-12-07 15:22:06 +00:00
br.f();
}