]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/default-method-simple.rs
Rollup merge of #60685 - dtolnay:spdx, r=nikomatsakis
[rust.git] / src / test / run-pass / default-method-simple.rs
1 #![allow(dead_code)]
2
3 trait Foo {
4     fn f(&self) {
5         println!("Hello!");
6         self.g();
7     }
8     fn g(&self);
9 }
10
11 struct A {
12     x: isize
13 }
14
15 impl Foo for A {
16     fn g(&self) {
17         println!("Goodbye!");
18     }
19 }
20
21 pub fn main() {
22     let a = A { x: 1 };
23     a.f();
24 }