Skip to content

Commit db18d14

Browse files
NadrierilCentril
andauthored
Apply suggestions from code review
Co-Authored-By: Mazdak Farrokhzad <[email protected]>
1 parent 1084eff commit db18d14

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/librustc_mir/hair/pattern/_match.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ impl<'tcx> Constructor<'tcx> {
726726

727727
/// This returns one wildcard pattern for each argument to this constructor.
728728
///
729-
/// This must be consistent with `apply`, `specialize_one_pattern` and `arity`.
729+
/// This must be consistent with `apply`, `specialize_one_pattern`, and `arity`.
730730
fn wildcard_subpatterns<'a>(
731731
&self,
732732
cx: &MatchCheckCtxt<'a, 'tcx>,
@@ -801,7 +801,7 @@ impl<'tcx> Constructor<'tcx> {
801801
/// For instance, a tuple pattern `(_, 42, Some([]))` has the arity of 3.
802802
/// A struct pattern's arity is the number of fields it contains, etc.
803803
///
804-
/// This must be consistent with `wildcard_subpatterns`, `specialize_one_pattern` and `apply`.
804+
/// This must be consistent with `wildcard_subpatterns`, `specialize_one_pattern`, and `apply`.
805805
fn arity<'a>(&self, cx: &MatchCheckCtxt<'a, 'tcx>, ty: Ty<'tcx>) -> u64 {
806806
debug!("Constructor::arity({:#?}, {:?})", self, ty);
807807
match ty.kind {
@@ -823,7 +823,7 @@ impl<'tcx> Constructor<'tcx> {
823823
/// Apply a constructor to a list of patterns, yielding a new pattern. `pats`
824824
/// must have as many elements as this constructor's arity.
825825
///
826-
/// This must be consistent with `wildcard_subpatterns`, `specialize_one_pattern` and `arity`.
826+
/// This must be consistent with `wildcard_subpatterns`, `specialize_one_pattern`, and `arity`.
827827
///
828828
/// Examples:
829829
/// `self`: `Constructor::Single`
@@ -1316,7 +1316,7 @@ impl<'tcx> IntRange<'tcx> {
13161316
None
13171317
}
13181318
} else {
1319-
// If the range sould not be treated exhaustively, fallback to checking for inclusion.
1319+
// If the range should not be treated exhaustively, fallback to checking for inclusion.
13201320
if other_lo <= lo && hi <= other_hi { Some(self.clone()) } else { None }
13211321
}
13221322
}

src/test/ui/pattern/usefulness/exhaustive_integer_patterns.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ fn main() {
160160
match &0 {
161161
&42 => {}
162162
&FOO => {} //~ ERROR unreachable pattern
163-
BAR => {} // not detected as unreachable because `try_eval_bits` fails on BAR
163+
BAR => {} // Not detected as unreachable because `try_eval_bits` fails on `BAR`.
164164
_ => {}
165165
}
166166
}

0 commit comments

Comments
 (0)