Skip to content

Commit a7e808e

Browse files
Add notes
1 parent 6b98704 commit a7e808e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/rustc_ast/src/ast.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,9 @@ pub enum BindingMode {
675675

676676
#[derive(Clone, Encodable, Decodable, Debug)]
677677
pub enum RangeEnd {
678+
/// `..=` or `...`
678679
Included(RangeSyntax),
680+
/// `..`
679681
Excluded,
680682
}
681683

@@ -687,6 +689,7 @@ pub enum RangeSyntax {
687689
DotDotEq,
688690
}
689691

692+
/// All the different flavors of pattern that Rust recognizes.
690693
#[derive(Clone, Encodable, Decodable, Debug)]
691694
pub enum PatKind {
692695
/// Represents a wildcard pattern (`_`).
@@ -727,7 +730,7 @@ pub enum PatKind {
727730
/// A literal.
728731
Lit(P<Expr>),
729732

730-
/// A range pattern (e.g., `1...2`, `1..=2` or `1..2`).
733+
/// A range pattern (e.g., `1...2`, `1..2`, `1..`, `..2`, `1..=2`, `..=2`).
731734
Range(Option<P<Expr>>, Option<P<Expr>>, Spanned<RangeEnd>),
732735

733736
/// A slice pattern `[a, b, c]`.

0 commit comments

Comments
 (0)