@@ -56,8 +56,10 @@ pub fn check_drop_impl(tcx: TyCtxt<'_>, drop_impl_did: DefId) -> Result<(), Erro
56
56
// already checked by coherence, but compilation may
57
57
// not have been terminated.
58
58
let span = tcx. def_span ( drop_impl_did) ;
59
- tcx. sess . delay_span_bug ( span,
60
- & format ! ( "should have been rejected by coherence check: {}" , dtor_self_type) ) ;
59
+ tcx. sess . delay_span_bug (
60
+ span,
61
+ & format ! ( "should have been rejected by coherence check: {}" , dtor_self_type) ,
62
+ ) ;
61
63
Err ( ErrorReported )
62
64
}
63
65
}
@@ -85,10 +87,7 @@ fn ensure_drop_params_and_item_params_correspond<'tcx>(
85
87
let fresh_impl_self_ty = drop_impl_ty. subst ( tcx, fresh_impl_substs) ;
86
88
87
89
let cause = & ObligationCause :: misc ( drop_impl_span, drop_impl_hir_id) ;
88
- match infcx
89
- . at ( cause, impl_param_env)
90
- . eq ( named_type, fresh_impl_self_ty)
91
- {
90
+ match infcx. at ( cause, impl_param_env) . eq ( named_type, fresh_impl_self_ty) {
92
91
Ok ( InferOk { obligations, .. } ) => {
93
92
fulfillment_cx. register_predicate_obligations ( infcx, obligations) ;
94
93
}
@@ -99,12 +98,13 @@ fn ensure_drop_params_and_item_params_correspond<'tcx>(
99
98
drop_impl_span,
100
99
E0366 ,
101
100
"Implementations of Drop cannot be specialized"
102
- ) . span_note (
101
+ )
102
+ . span_note (
103
103
item_span,
104
104
"Use same sequence of generic type and region \
105
105
parameters that is on the struct/enum definition",
106
106
)
107
- . emit ( ) ;
107
+ . emit ( ) ;
108
108
return Err ( ErrorReported ) ;
109
109
}
110
110
}
@@ -245,12 +245,13 @@ fn ensure_drop_predicates_are_implied_by_item_defn<'tcx>(
245
245
E0367 ,
246
246
"The requirement `{}` is added only by the Drop impl." ,
247
247
predicate
248
- ) . span_note (
248
+ )
249
+ . span_note (
249
250
item_span,
250
251
"The same requirement must be part of \
251
252
the struct/enum definition",
252
253
)
253
- . emit ( ) ;
254
+ . emit ( ) ;
254
255
result = Err ( ErrorReported ) ;
255
256
}
256
257
}
0 commit comments