X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_hir%2Fsrc%2Fhir.rs;h=2f379b85b92c7bbb1d6043d9f878b49808e1c94f;hb=d6c9254cac0009ba3d497cfa859572c4df21f5b9;hp=dfeee3f356ffb3f8cb2a78fe8cf91a7573c0c801;hpb=7a915dd80d24a90c6507ff3ff38519c9b8578b91;p=rust.git diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index dfeee3f356f..2f379b85b92 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -49,15 +49,15 @@ pub enum ParamName { /// 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), @@ -1082,7 +1082,7 @@ pub enum PatKind<'hir> { /// 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>]), @@ -1441,7 +1441,7 @@ pub enum AsyncGeneratorKind { /// 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. @@ -2078,10 +2078,7 @@ pub enum YieldSource { impl YieldSource { pub fn is_await(&self) -> bool { - match self { - YieldSource::Await { .. } => true, - YieldSource::Yield => false, - } + matches!(self, YieldSource::Await { .. }) } } @@ -2247,7 +2244,7 @@ pub enum ImplItemKind<'hir> { /// wouldn't it be better to make the `ty` field an enum like the /// following? /// -/// ``` +/// ```ignore (pseudo-rust) /// enum TypeBindingKind { /// Equals(...), /// Binding(...),