]> git.lizzy.rs Git - rust.git/blob - src/test/ui/self/arbitrary_self_types_silly.rs
Update ui tests
[rust.git] / src / test / ui / self / arbitrary_self_types_silly.rs
1 // run-pass
2 #![feature(arbitrary_self_types)]
3
4 struct Foo;
5 struct Bar;
6
7 impl std::ops::Deref for Bar {
8     type Target = Foo;
9
10     fn deref(&self) -> &Foo {
11         &Foo
12     }
13 }
14
15 impl Foo {
16     fn bar(self: Bar) -> i32 { 3 }
17 }
18
19 fn main() {
20     assert_eq!(3, Bar.bar());
21 }