diff options
Diffstat (limited to 'tests/ui/traits/trait-implementation-restriction-5988.rs')
| -rw-r--r-- | tests/ui/traits/trait-implementation-restriction-5988.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/traits/trait-implementation-restriction-5988.rs b/tests/ui/traits/trait-implementation-restriction-5988.rs new file mode 100644 index 00000000000..d3a5b10569b --- /dev/null +++ b/tests/ui/traits/trait-implementation-restriction-5988.rs @@ -0,0 +1,24 @@ +// https://github.com/rust-lang/rust/issues/5988 +//@ run-pass + +trait B { + fn f(&self); +} + +trait T : B { +} + +struct A; + +impl<U: T> B for U { + fn f(&self) { } +} + +impl T for A { +} + +fn main() { + let a = A; + let br = &a as &dyn B; + br.f(); +} |
