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

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

17 lines
226 B
Rust
Raw Normal View History

//@ run-pass
2016-10-12 10:10:39 +00:00
trait ToRef<'a> {
type Ref: 'a;
}
impl<'a, U: 'a> ToRef<'a> for U {
type Ref = &'a U;
}
fn example<'a, T>(value: &'a T) -> (<T as ToRef<'a>>::Ref, u32) {
(value, 0)
}
fn main() {
example(&0);
}