Skip to content

Commit 17f0b0a

Browse files
committed
Adjust some comments on THIR PatKind::Variant and PatKind::Leaf
`PatKind::Variant` is always used for enum variants, even for enums that only have one variant.
1 parent 45fc6fe commit 17f0b0a

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

compiler/rustc_middle/src/thir.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -788,17 +788,15 @@ pub enum PatKind<'tcx> {
788788
is_shorthand: bool,
789789
},
790790

791-
/// `Foo(...)` or `Foo{...}` or `Foo`, where `Foo` is a variant name from an ADT with
792-
/// multiple variants.
791+
/// `Foo(..)` or `Foo { .. }` or `Foo`, where `Foo` is an enum variant.
793792
Variant {
794793
adt_def: AdtDef<'tcx>,
795794
args: GenericArgsRef<'tcx>,
796795
variant_index: VariantIdx,
797796
subpatterns: Vec<FieldPat<'tcx>>,
798797
},
799798

800-
/// `(...)`, `Foo(...)`, `Foo{...}`, or `Foo`, where `Foo` is a variant name from an ADT with
801-
/// a single variant.
799+
/// `(..)`, `Foo(..)`, `Foo { .. }`, or `Foo`, where `Foo` is a struct.
802800
Leaf {
803801
subpatterns: Vec<FieldPat<'tcx>>,
804802
},

0 commit comments

Comments
 (0)