Lines Matching full:lifetime
6 use crate::lifetime::Lifetime;
37 /// A generic type parameter, lifetime, or const generic: `T: Into<String>`,
47 /// A lifetime parameter: `'a: 'b + 'c + 'd`.
48 Lifetime(LifetimeParam),
59 /// A lifetime definition: `'a: 'b + 'c + 'd`.
63 pub lifetime: Lifetime,
65 pub bounds: Punctuated<Lifetime, Token![+]>,
109 /// Iterator over the lifetime parameters in `self.params`.
116 /// Iterator over the lifetime parameters in `self.params`.
193 if let GenericParam::Lifetime(lifetime) = self.0.next()? { in next()
194 Some(lifetime) in next()
207 if let GenericParam::Lifetime(lifetime) = self.0.next()? { in next()
208 Some(lifetime) in next()
377 pub fn new(lifetime: Lifetime) -> Self { in new()
380 lifetime, in new()
401 /// A trait or lifetime used as a bound on a type parameter.
406 Lifetime(Lifetime),
453 /// A lifetime parameter in precise capturing bound: `fn f<'a>() -> impl
455 Lifetime(Lifetime),
484 /// A lifetime predicate in a `where` clause: `'a: 'b + 'c`.
485 Lifetime(PredicateLifetime),
493 /// A lifetime predicate in a `where` clause: `'a: 'b + 'c`.
496 pub lifetime: Lifetime,
498 pub bounds: Punctuated<Lifetime, Token![+]>,
511 /// Trait and lifetime bounds (`Clone+Send+'static`)
531 use crate::lifetime::Lifetime;
556 if lookahead.peek(Lifetime) { in parse()
557 params.push_value(GenericParam::Lifetime(LifetimeParam { in parse()
613 } else if lookahead.peek(Lifetime) { in parse()
614 Ok(GenericParam::Lifetime(LifetimeParam { in parse()
635 lifetime: input.parse()?, in parse()
759 if input.peek(Lifetime) { in parse_single()
760 return input.parse().map(TypeParamBound::Lifetime); in parse_single()
814 || input.peek(Lifetime) in parse_multiple()
980 if input.peek(Lifetime) && input.peek2(Token![:]) { in parse()
981 Ok(WherePredicate::Lifetime(PredicateLifetime { in parse()
982 lifetime: input.parse()?, in parse()
1056 if lookahead.peek(Lifetime) || lookahead.peek(Ident) || input.peek(Token![Self]) in parse()
1089 if lookahead.peek(Lifetime) { in parse()
1090 input.parse().map(CapturedParam::Lifetime) in parse()
1110 // `<` LIFETIME `>` - single lifetime parameter in choose_generics_over_qpath()
1111 // `<` (LIFETIME|IDENT) `,` - first generic parameter in a list in choose_generics_over_qpath()
1112 // `<` (LIFETIME|IDENT) `:` - generic parameter with bounds in choose_generics_over_qpath()
1113 // `<` (LIFETIME|IDENT) `=` - generic parameter with a default in choose_generics_over_qpath()
1125 || (input.peek2(Lifetime) || input.peek2(Ident)) in choose_generics_over_qpath()
1174 if let GenericParam::Lifetime(_) = **param.value() { in to_tokens()
1188 GenericParam::Lifetime(_) => {} in to_tokens()
1208 if let GenericParam::Lifetime(_) = **param.value() { in to_tokens()
1214 if let GenericParam::Lifetime(_) = **param.value() { in to_tokens()
1222 GenericParam::Lifetime(_) => unreachable!(), in to_tokens()
1260 if let GenericParam::Lifetime(def) = *param.value() { in to_tokens()
1261 // Leave off the lifetime bounds and attributes in to_tokens()
1262 def.lifetime.to_tokens(tokens); in to_tokens()
1268 if let GenericParam::Lifetime(_) = **param.value() { in to_tokens()
1276 GenericParam::Lifetime(_) => unreachable!(), in to_tokens()
1316 self.lifetime.to_tokens(tokens); in to_tokens()
1393 self.lifetime.to_tokens(tokens); in to_tokens()
1420 if let CapturedParam::Lifetime(_) = **param.value() { in to_tokens()
1444 CapturedParam::Lifetime(lifetime) => lifetime.to_tokens(tokens), in to_tokens()