]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/cache-issue-18209.rs
Add 'src/tools/rust-analyzer/' from commit '977e12a0bdc3e329af179ef3a9d466af9eb613bb'
[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() { }