rust/tests/ui/issues/issue-20414.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
377 B
Rust
Raw Normal View History

// check-pass
#![allow(dead_code)]
// pretty-expanded FIXME #23616
2015-01-09 07:35:17 +00:00
trait Trait {
fn method(self) -> isize;
2015-01-09 07:35:17 +00:00
}
struct Wrapper<T> {
field: T
}
impl<'a, T> Trait for &'a Wrapper<T> where &'a T: Trait {
fn method(self) -> isize {
2015-01-09 07:35:17 +00:00
let r: &'a T = &self.field;
Trait::method(r); // these should both work
r.method()
}
}
fn main() {}