2015-02-12 05:16:02 -05:00
|
|
|
#![allow(dead_code)]
|
|
|
|
|
|
|
|
trait Get {
|
|
|
|
fn get(&self) -> Self;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn get_min_from_max<'min, 'max, G>()
|
2015-12-15 04:31:58 -05:00
|
|
|
where 'max : 'min, &'max G : Get, G : 'max
|
2015-02-12 05:16:02 -05:00
|
|
|
{
|
2022-04-01 22:12:17 -04:00
|
|
|
impls_get::<&'min G>();
|
2022-04-01 13:13:25 -04:00
|
|
|
//~^ ERROR lifetime may not live long enough
|
2015-02-12 05:16:02 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn get_max_from_min<'min, 'max, G>()
|
2015-12-15 04:31:58 -05:00
|
|
|
where 'max : 'min, &'min G : Get, G : 'min
|
2015-02-12 05:16:02 -05:00
|
|
|
{
|
2022-04-01 22:12:17 -04:00
|
|
|
impls_get::<&'max G>();
|
2022-04-01 13:13:25 -04:00
|
|
|
//~^ ERROR lifetime may not live long enough
|
2015-02-12 05:16:02 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn impls_get<G>() where G : Get { }
|
|
|
|
|
|
|
|
fn main() { }
|