summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/default-method/macro.rs
blob: 2b50ee9b42210951e8ac08f3008b88fc1dd42091 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// run-pass


trait Foo {
    fn bar(&self) -> String {
        format!("test")
    }
}

enum Baz {
    Quux
}

impl Foo for Baz {
}

pub fn main() {
    let q = Baz::Quux;
    assert_eq!(q.bar(), "test".to_string());
}