Skip to content

Commit 9165dd0

Browse files
NadrierilCentril
andcommitted
Apply suggestions from code review
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
1 parent c38aad4 commit 9165dd0

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
@@ -737,7 +737,7 @@ impl<'tcx> Constructor<'tcx> {
737737

738738
/// This returns one wildcard pattern for each argument to this constructor.
739739
///
740-
/// This must be consistent with `apply`, `specialize_one_pattern` and `arity`.
740+
/// This must be consistent with `apply`, `specialize_one_pattern`, and `arity`.
741741
fn wildcard_subpatterns<'a>(
742742
&self,
743743
cx: &MatchCheckCtxt<'a, 'tcx>,
@@ -815,7 +815,7 @@ impl<'tcx> Constructor<'tcx> {
815815
/// For instance, a tuple pattern `(_, 42, Some([]))` has the arity of 3.
816816
/// A struct pattern's arity is the number of fields it contains, etc.
817817
///
818-
/// This must be consistent with `wildcard_subpatterns`, `specialize_one_pattern` and `apply`.
818+
/// This must be consistent with `wildcard_subpatterns`, `specialize_one_pattern`, and `apply`.
819819
fn arity<'a>(&self, cx: &MatchCheckCtxt<'a, 'tcx>, ty: Ty<'tcx>) -> u64 {
820820
debug!("Constructor::arity({:#?}, {:?})", self, ty);
821821
match self {
@@ -837,7 +837,7 @@ impl<'tcx> Constructor<'tcx> {
837837
/// Apply a constructor to a list of patterns, yielding a new pattern. `pats`
838838
/// must have as many elements as this constructor's arity.
839839
///
840-
/// This must be consistent with `wildcard_subpatterns`, `specialize_one_pattern` and `arity`.
840+
/// This must be consistent with `wildcard_subpatterns`, `specialize_one_pattern`, and `arity`.
841841
///
842842
/// Examples:
843843
/// `self`: `Constructor::Single`
@@ -1369,7 +1369,7 @@ impl<'tcx> IntRange<'tcx> {
13691369
None
13701370
}
13711371
} else {
1372-
// If the range sould not be treated exhaustively, fallback to checking for inclusion.
1372+
// If the range should not be treated exhaustively, fallback to checking for inclusion.
13731373
if other_lo <= lo && hi <= other_hi { Some(self.clone()) } else { None }
13741374
}
13751375
}

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)