diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 98ff5ccc82f..b282c7333d6 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -305,7 +305,11 @@ impl<'a, 'tcx> Expectation<'tcx> { match *self { ExpectHasType(ety) => { let ety = fcx.shallow_resolve(ety); - if !ety.is_ty_var() { ExpectHasType(ety) } else { NoExpectation } + if !ety.is_ty_var() { + ExpectHasType(ety) + } else { + NoExpectation + } } ExpectRvalueLikeUnsized(ety) => ExpectRvalueLikeUnsized(ety), _ => NoExpectation, @@ -1618,7 +1622,11 @@ fn check_opaque_for_inheriting_lifetimes(tcx: TyCtxt<'tcx>, def_id: DefId, span: impl<'tcx> ty::fold::TypeVisitor<'tcx> for ProhibitOpaqueVisitor<'tcx> { fn visit_ty(&mut self, t: Ty<'tcx>) -> bool { debug!("check_opaque_for_inheriting_lifetimes: (visit_ty) t={:?}", t); - if t == self.opaque_identity_ty { false } else { t.super_visit_with(self) } + if t == self.opaque_identity_ty { + false + } else { + t.super_visit_with(self) + } } fn visit_region(&mut self, r: ty::Region<'tcx>) -> bool { @@ -1978,8 +1986,8 @@ fn check_impl_items_against_trait<'tcx>( match tcx.impl_polarity(impl_id) { ty::ImplPolarity::Reservation | ty::ImplPolarity::Positive => {} ty::ImplPolarity::Negative => { - if !impl_item_refs.is_empty() { - let first_item_span = tcx.hir().impl_item(impl_item_refs[0].id).span; + if let [first_item_ref, ..] = impl_item_refs { + let first_item_span = tcx.hir().impl_item(first_item_ref.id).span; struct_span_err!( tcx.sess, first_item_span, @@ -3767,8 +3775,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { &'b self, self_ty: ty::TyVid, ) -> impl Iterator, traits::PredicateObligation<'tcx>)> - + Captures<'tcx> - + 'b { + + Captures<'tcx> + + 'b { // FIXME: consider using `sub_root_var` here so we // can see through subtyping. let ty_var_root = self.root_var(self_ty);