2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
2014-10-22 11:35:53 -04:00
|
|
|
// Test that the cache results from the default method do not pollute
|
|
|
|
// the cache for the later call in `load()`.
|
|
|
|
//
|
|
|
|
// See issue #18209.
|
|
|
|
|
2015-03-22 13:13:15 -07:00
|
|
|
//@ pretty-expanded FIXME #23616
|
|
|
|
|
2014-10-22 11:35:53 -04:00
|
|
|
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() { }
|