]> git.proxmox.com Git - rustc.git/blob - tests/ui/traits/default-method/trivial.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / traits / default-method / trivial.rs
1 // run-pass
2
3
4 trait Cat {
5 fn meow(&self) -> bool;
6 fn scratch(&self) -> bool;
7 fn purr(&self) -> bool { true }
8 }
9
10 impl Cat for isize {
11 fn meow(&self) -> bool {
12 self.scratch()
13 }
14 fn scratch(&self) -> bool {
15 self.purr()
16 }
17 }
18
19 pub fn main() {
20 assert!(5.meow());
21 }