about summary refs log tree commit diff
path: root/tests/ui/borrowck/implied-bound-from-normalized-arg.rs
blob: 4e9a4953c6b7e7c7a21c61c8f9042c4e1f914e1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//@ check-pass
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver

// Make sure that we can normalize `<T as Ref<'a>>::Assoc` to `&'a T` and get
// its implied bounds.

trait Ref<'a> {
    type Assoc;
}
impl<'a, T> Ref<'a> for T where T: 'a {
    type Assoc = &'a T;
}

fn outlives<'a, T: 'a>() {}

fn test<'a, T>(_: <T as Ref<'a>>::Assoc) {
    outlives::<'a, T>();
}

fn main() {}