diff options
| author | mark <markm@cs.wisc.edu> | 2020-04-09 09:31:52 -0500 |
|---|---|---|
| committer | mark <markm@cs.wisc.edu> | 2020-04-09 09:31:52 -0500 |
| commit | f2e4709f2252103a2461991dba209f8ab4d76aca (patch) | |
| tree | 2dec83755c18c7629f78d2d8723059f8393ffe63 | |
| parent | e1c838d737ffd30172e394eaf64dd087529a2b6f (diff) | |
| download | rust-f2e4709f2252103a2461991dba209f8ab4d76aca.tar.gz rust-f2e4709f2252103a2461991dba209f8ab4d76aca.zip | |
improve comments
| -rw-r--r-- | src/librustc_typeck/check/pat.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc_typeck/check/pat.rs b/src/librustc_typeck/check/pat.rs index 37f0efd4064..0335aba9144 100644 --- a/src/librustc_typeck/check/pat.rs +++ b/src/librustc_typeck/check/pat.rs @@ -1360,8 +1360,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { let min = before.len() as u64 + after.len() as u64; let (opt_slice_ty, expected) = self.check_array_pat_len(span, element_ty, expected, slice, len, min); - // opt_slice_ty.is_none() => slice.is_none() - // Note, though, that opt_slice_ty could be Some(error_ty). + // `opt_slice_ty.is_none()` => `slice.is_none()`. + // Note, though, that opt_slice_ty could be `Some(error_ty)`. assert!(opt_slice_ty.is_some() || slice.is_none()); (element_ty, opt_slice_ty, expected) } @@ -1394,7 +1394,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { /// Type check the length of an array pattern. /// /// Returns both the type of the variable length pattern (or `None`), and the potentially - /// inferred array type. We should only return `None` for the slice type if `slice.is_none()`. + /// inferred array type. We only return `None` for the slice type if `slice.is_none()`. fn check_array_pat_len( &self, span: Span, |
