@@ -305,7 +305,11 @@ impl<'a, 'tcx> Expectation<'tcx> {
305
305
match * self {
306
306
ExpectHasType ( ety) => {
307
307
let ety = fcx. shallow_resolve ( ety) ;
308
- if !ety. is_ty_var ( ) { ExpectHasType ( ety) } else { NoExpectation }
308
+ if !ety. is_ty_var ( ) {
309
+ ExpectHasType ( ety)
310
+ } else {
311
+ NoExpectation
312
+ }
309
313
}
310
314
ExpectRvalueLikeUnsized ( ety) => ExpectRvalueLikeUnsized ( ety) ,
311
315
_ => NoExpectation ,
@@ -1618,7 +1622,11 @@ fn check_opaque_for_inheriting_lifetimes(tcx: TyCtxt<'tcx>, def_id: DefId, span:
1618
1622
impl < ' tcx > ty:: fold:: TypeVisitor < ' tcx > for ProhibitOpaqueVisitor < ' tcx > {
1619
1623
fn visit_ty ( & mut self , t : Ty < ' tcx > ) -> bool {
1620
1624
debug ! ( "check_opaque_for_inheriting_lifetimes: (visit_ty) t={:?}" , t) ;
1621
- if t == self . opaque_identity_ty { false } else { t. super_visit_with ( self ) }
1625
+ if t == self . opaque_identity_ty {
1626
+ false
1627
+ } else {
1628
+ t. super_visit_with ( self )
1629
+ }
1622
1630
}
1623
1631
1624
1632
fn visit_region ( & mut self , r : ty:: Region < ' tcx > ) -> bool {
@@ -1978,8 +1986,8 @@ fn check_impl_items_against_trait<'tcx>(
1978
1986
match tcx. impl_polarity ( impl_id) {
1979
1987
ty:: ImplPolarity :: Reservation | ty:: ImplPolarity :: Positive => { }
1980
1988
ty:: ImplPolarity :: Negative => {
1981
- if !impl_item_refs . is_empty ( ) {
1982
- let first_item_span = tcx. hir ( ) . impl_item ( impl_item_refs [ 0 ] . id ) . span ;
1989
+ if let [ first_item_ref , .. ] = impl_item_refs {
1990
+ let first_item_span = tcx. hir ( ) . impl_item ( first_item_ref . id ) . span ;
1983
1991
struct_span_err ! (
1984
1992
tcx. sess,
1985
1993
first_item_span,
@@ -3767,8 +3775,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
3767
3775
& ' b self ,
3768
3776
self_ty : ty:: TyVid ,
3769
3777
) -> impl Iterator < Item = ( ty:: PolyTraitRef < ' tcx > , traits:: PredicateObligation < ' tcx > ) >
3770
- + Captures < ' tcx >
3771
- + ' b {
3778
+ + Captures < ' tcx >
3779
+ + ' b {
3772
3780
// FIXME: consider using `sub_root_var` here so we
3773
3781
// can see through subtyping.
3774
3782
let ty_var_root = self . root_var ( self_ty) ;
0 commit comments