mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-22 03:44:24 +00:00

Done with ```bash sd '//@ pretty-expanded.*\n' '' tests/ui/**/*.rs ``` and ``` sd '//@pretty-expanded.*\n' '' tests/ui/**/*.rs ```
20 lines
333 B
Rust
20 lines
333 B
Rust
//@ 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() { }
|