2019-11-03 18:00:00 -06:00
|
|
|
// check-pass
|
2018-09-25 16:51:35 -05:00
|
|
|
#![allow(dead_code)]
|
2015-03-22 15:13:15 -05:00
|
|
|
// pretty-expanded FIXME #23616
|
|
|
|
|
2015-01-09 01:35:17 -06:00
|
|
|
trait Trait {
|
2015-03-25 19:06:52 -05:00
|
|
|
fn method(self) -> isize;
|
2015-01-09 01:35:17 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
struct Wrapper<T> {
|
|
|
|
field: T
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a, T> Trait for &'a Wrapper<T> where &'a T: Trait {
|
2015-03-25 19:06:52 -05:00
|
|
|
fn method(self) -> isize {
|
2015-01-09 01:35:17 -06:00
|
|
|
let r: &'a T = &self.field;
|
|
|
|
Trait::method(r); // these should both work
|
|
|
|
r.method()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|