about summary refs log tree commit diff
path: root/tests/ui/traits/cache-issue-18209.rs
blob: 6a027d6b3f3dde00c05344baefde460e341b2d2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//@ run-pass
// Test that the cache results from the default method do not pollute
// the cache for the later call in `load()`.
//
// See issue #18209.


pub trait Foo {
    fn load_from() -> Box<Self>;
    fn load() -> Box<Self> {
        Foo::load_from()
    }
}

pub fn load<M: Foo>() -> Box<M> {
    Foo::load()
}

fn main() { }