mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-03 04:04:06 +00:00
13 lines
300 B
Rust
13 lines
300 B
Rust
#![crate_type = "lib"]
|
|
|
|
pub trait Foo<'a, T> {
|
|
fn foo(&'a self) -> T;
|
|
}
|
|
|
|
pub fn foo<'a, T>(x: &'a Foo<'a, T>) -> T {
|
|
let x: &'a Foo<T> = x;
|
|
// ^ the lifetime parameter of Foo is left to be inferred.
|
|
x.foo()
|
|
// ^ encoding this method call in metadata triggers an ICE.
|
|
}
|