3 // Check that a trait is still object-safe (and usable) if it has
4 // methods with by-value self so long as they require `Self : Sized`.
8 fn tick(&mut self) -> u32;
9 fn get(self) -> u32 where Self : Sized;
16 impl Counter for CCounter {
17 fn tick(&mut self) -> u32 { self.c += 1; self.c }
18 fn get(self) -> u32 where Self : Sized { self.c }
21 fn tick1<C:Counter>(mut c: C) -> u32 {
26 fn tick2(c: &mut dyn Counter) {
30 fn tick3<C:?Sized+Counter>(c: &mut C) {
36 let mut c = CCounter { c: 0 };