Skip to content

Commit ab239f3

Browse files
author
Alexander Regueiro
committed
Minor cosmetic changes
1 parent 87532e9 commit ab239f3

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

src/librustc_typeck/check/_match.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
275275
PatKind::Tuple(ref elements, ddpos) => {
276276
let mut expected_len = elements.len();
277277
if ddpos.is_some() {
278-
// Require known type only when `..` is present
278+
// Require known type only when `..` is present.
279279
if let ty::Tuple(ref tys) =
280280
self.structurally_resolved_type(pat.span, expected).sty {
281281
expected_len = tys.len();
@@ -284,8 +284,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
284284
let max_len = cmp::max(expected_len, elements.len());
285285

286286
let element_tys_iter = (0..max_len).map(|_| self.next_ty_var(
287-
// FIXME: MiscVariable for now, obtaining the span and name information
288-
// from all tuple elements isn't trivial.
287+
// FIXME: `MiscVariable` for now -- obtaining the span and name information
288+
// from all tuple elements isn't trivial.
289289
TypeVariableOrigin::TypeInference(pat.span)));
290290
let element_tys = tcx.mk_type_list(element_tys_iter);
291291
let pat_ty = tcx.mk_ty(ty::Tuple(element_tys));

src/librustc_typeck/check/mod.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -4615,7 +4615,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
46154615
local: &'gcx hir::Local,
46164616
init: &'gcx hir::Expr) -> Ty<'tcx>
46174617
{
4618-
// FIXME(tschottdorf): contains_explicit_ref_binding() must be removed
4618+
// FIXME(tschottdorf): `contains_explicit_ref_binding()` must be removed
46194619
// for #42640 (default match binding modes).
46204620
//
46214621
// See #44848.
@@ -4660,7 +4660,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
46604660
}
46614661

46624662
pub fn check_stmt(&self, stmt: &'gcx hir::Stmt) {
4663-
// Don't do all the complex logic below for DeclItem.
4663+
// Don't do all the complex logic below for `DeclItem`.
46644664
match stmt.node {
46654665
hir::StmtKind::Decl(ref decl, _) => {
46664666
if let hir::DeclKind::Item(_) = decl.node {
@@ -4672,7 +4672,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
46724672

46734673
self.warn_if_unreachable(stmt.node.id(), stmt.span, "statement");
46744674

4675-
// Hide the outer diverging and has_errors flags.
4675+
// Hide the outer diverging and `has_errors` flags.
46764676
let old_diverges = self.diverges.get();
46774677
let old_has_errors = self.has_errors.get();
46784678
self.diverges.set(Diverges::Maybe);
@@ -4684,19 +4684,20 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
46844684
hir::DeclKind::Local(ref l) => {
46854685
self.check_decl_local(&l);
46864686
}
4687-
hir::DeclKind::Item(_) => {/* ignore for now */}
4687+
// Ignore for now.
4688+
hir::DeclKind::Item(_) => ()
46884689
}
46894690
}
46904691
hir::StmtKind::Expr(ref expr, _) => {
4691-
// Check with expected type of ()
4692+
// Check with expected type of `()`.
46924693
self.check_expr_has_type_or_error(&expr, self.tcx.mk_unit());
46934694
}
46944695
hir::StmtKind::Semi(ref expr, _) => {
46954696
self.check_expr(&expr);
46964697
}
46974698
}
46984699

4699-
// Combine the diverging and has_error flags.
4700+
// Combine the diverging and `has_error` flags.
47004701
self.diverges.set(self.diverges.get() | old_diverges);
47014702
self.has_errors.set(self.has_errors.get() | old_has_errors);
47024703
}

0 commit comments

Comments
 (0)