mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 10:45:18 +00:00
22 lines
379 B
Rust
22 lines
379 B
Rust
//@ check-pass
|
|
#![allow(dead_code)]
|
|
//@ pretty-expanded FIXME #23616
|
|
|
|
trait Trait {
|
|
fn method(self) -> isize;
|
|
}
|
|
|
|
struct Wrapper<T> {
|
|
field: T
|
|
}
|
|
|
|
impl<'a, T> Trait for &'a Wrapper<T> where &'a T: Trait {
|
|
fn method(self) -> isize {
|
|
let r: &'a T = &self.field;
|
|
Trait::method(r); // these should both work
|
|
r.method()
|
|
}
|
|
}
|
|
|
|
fn main() {}
|