@@ -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 ,
@@ -1615,7 +1619,11 @@ fn check_opaque_for_inheriting_lifetimes(tcx: TyCtxt<'tcx>, def_id: DefId, span:
1615
1619
impl < ' tcx > ty:: fold:: TypeVisitor < ' tcx > for ProhibitOpaqueVisitor < ' tcx > {
1616
1620
fn visit_ty ( & mut self , t : Ty < ' tcx > ) -> bool {
1617
1621
debug ! ( "check_opaque_for_inheriting_lifetimes: (visit_ty) t={:?}" , t) ;
1618
- if t == self . opaque_identity_ty { false } else { t. super_visit_with ( self ) }
1622
+ if t == self . opaque_identity_ty {
1623
+ false
1624
+ } else {
1625
+ t. super_visit_with ( self )
1626
+ }
1619
1627
}
1620
1628
1621
1629
fn visit_region ( & mut self , r : ty:: Region < ' tcx > ) -> bool {
@@ -1975,8 +1983,8 @@ fn check_impl_items_against_trait<'tcx>(
1975
1983
match tcx. impl_polarity ( impl_id) {
1976
1984
ty:: ImplPolarity :: Reservation | ty:: ImplPolarity :: Positive => { }
1977
1985
ty:: ImplPolarity :: Negative => {
1978
- if !impl_item_refs . is_empty ( ) {
1979
- let first_item_span = tcx. hir ( ) . impl_item ( impl_item_refs [ 0 ] . id ) . span ;
1986
+ if let [ first_item_ref , .. ] = impl_item_refs {
1987
+ let first_item_span = tcx. hir ( ) . impl_item ( first_item_ref . id ) . span ;
1980
1988
struct_span_err ! (
1981
1989
tcx. sess,
1982
1990
first_item_span,
@@ -3770,8 +3778,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
3770
3778
& ' b self ,
3771
3779
self_ty : ty:: TyVid ,
3772
3780
) -> impl Iterator < Item = ( ty:: PolyTraitRef < ' tcx > , traits:: PredicateObligation < ' tcx > ) >
3773
- + Captures < ' tcx >
3774
- + ' b {
3781
+ + Captures < ' tcx >
3782
+ + ' b {
3775
3783
// FIXME: consider using `sub_root_var` here so we
3776
3784
// can see through subtyping.
3777
3785
let ty_var_root = self . root_var ( self_ty) ;
0 commit comments