/// Synthetic name generated when user elided a lifetime in an impl header.
///
/// E.g., the lifetimes in cases like these:
- ///
- /// impl Foo for &u32
- /// impl Foo<'_> for u32
- ///
+ /// ```ignore (fragment)
+ /// impl Foo for &u32
+ /// impl Foo<'_> for u32
+ /// ```
/// in that case, we rewrite to
- ///
- /// impl<'f> Foo for &'f u32
- /// impl<'f> Foo<'f> for u32
- ///
+ /// ```ignore (fragment)
+ /// impl<'f> Foo for &'f u32
+ /// impl<'f> Foo<'f> for u32
+ /// ```
/// where `'f` is something like `Fresh(0)`. The indices are
/// unique per impl, but not necessarily continuous.
Fresh(LocalDefId),
/// If `slice` exists, then `after` can be non-empty.
///
/// The representation for e.g., `[a, b, .., c, d]` is:
- /// ```
+ /// ```ignore (illustrative)
/// PatKind::Slice([Binding(a), Binding(b)], Some(Wild), [Binding(c), Binding(d)])
/// ```
Slice(&'hir [Pat<'hir>], Option<&'hir Pat<'hir>>, &'hir [Pat<'hir>]),
/// An explicit `async` block written by the user.
Block,
- /// An explicit `async` block written by the user.
+ /// An explicit `async` closure written by the user.
Closure,
/// The `async` block generated as the body of an async function.
impl YieldSource {
pub fn is_await(&self) -> bool {
- match self {
- YieldSource::Await { .. } => true,
- YieldSource::Yield => false,
- }
+ matches!(self, YieldSource::Await { .. })
}
}
/// wouldn't it be better to make the `ty` field an enum like the
/// following?
///
-/// ```
+/// ```ignore (pseudo-rust)
/// enum TypeBindingKind {
/// Equals(...),
/// Binding(...),