]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/cache-issue-18209.rs
Merge commit 'c19edfd71a1d0ddef86c2c67fdb40718d40a72b4' into sync_cg_clif-2022-07-25
[rust.git] / src / test / ui / traits / cache-issue-18209.rs
1 // run-pass
2 // Test that the cache results from the default method do not pollute
3 // the cache for the later call in `load()`.
4 //
5 // See issue #18209.
6
7 // pretty-expanded FIXME #23616
8
9 pub trait Foo {
10     fn load_from() -> Box<Self>;
11     fn load() -> Box<Self> {
12         Foo::load_from()
13     }
14 }
15
16 pub fn load<M: Foo>() -> Box<M> {
17     Foo::load()
18 }
19
20 fn main() { }