2 #![allow(unused_variables)]
3 // Issue #12856: a lifetime formal binding introduced by a generic fn
4 // should not upset the variance inference for actual occurrences of
5 // that lifetime in type expressions.
8 pub trait HasLife<'a> {
9 fn dummy(&'a self) { } // just to induce a variance on 'a
13 fn refs<'a, H: HasLife<'a>>(&'a self) -> H;
17 fn refs<'a, T: 'a, H: HasType<&'a T>>(&'a self) -> H;
23 fn dummy(&self, t: T) -> T { panic!() }
28 fn refs<'a, H: HasType<&'a T>>(&'a self) -> H where T: 'a;
32 // (The functions below were not actually a problem observed during
33 // fixing of #12856; they just seem like natural tests to put in to
34 // cover a couple more points in the testing space)
36 pub fn top_refs_1<'a, H: HasLife<'a>>(_s: &'a ()) -> H {
40 pub fn top_refs_2<'a, T: 'a, H: HasType<&'a T>>(_s: &'a ()) -> H {