]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/default-method/self.rs
:arrow_up: rust-analyzer
[rust.git] / src / test / ui / traits / default-method / self.rs
1 // run-pass
2
3
4 trait Cat {
5     fn meow(&self) -> bool;
6     fn scratch(&self) -> bool { self.purr() }
7     fn purr(&self) -> bool { true }
8 }
9
10 impl Cat for isize {
11     fn meow(&self) -> bool {
12         self.scratch()
13     }
14 }
15
16 pub fn main() {
17     assert!(5.meow());
18 }