@@ -195,8 +195,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
195
195
obligation : & PredicateObligation < ' tcx > ,
196
196
error : & MismatchedProjectionTypes < ' tcx > ,
197
197
) {
198
- let predicate =
199
- self . resolve_vars_if_possible ( & obligation. predicate ) ;
198
+ let predicate = self . resolve_vars_if_possible ( & obligation. predicate ) ;
200
199
201
200
if predicate. references_error ( ) {
202
201
return
@@ -228,7 +227,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
228
227
& mut obligations
229
228
) ;
230
229
if let Err ( error) = self . at ( & obligation. cause , obligation. param_env )
231
- . eq ( normalized_ty, data. ty ) {
230
+ . eq ( normalized_ty, data. ty )
231
+ {
232
232
values = Some ( infer:: ValuePairs :: Types ( ExpectedFound {
233
233
expected : normalized_ty,
234
234
found : data. ty ,
@@ -239,13 +239,19 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
239
239
}
240
240
241
241
let msg = format ! ( "type mismatch resolving `{}`" , predicate) ;
242
- let error_id = ( DiagnosticMessageId :: ErrorId ( 271 ) ,
243
- Some ( obligation. cause . span ) , msg) ;
242
+ let error_id = (
243
+ DiagnosticMessageId :: ErrorId ( 271 ) ,
244
+ Some ( obligation. cause . span ) ,
245
+ msg,
246
+ ) ;
244
247
let fresh = self . tcx . sess . one_time_diagnostics . borrow_mut ( ) . insert ( error_id) ;
245
248
if fresh {
246
249
let mut diag = struct_span_err ! (
247
- self . tcx. sess, obligation. cause. span, E0271 ,
248
- "type mismatch resolving `{}`" , predicate
250
+ self . tcx. sess,
251
+ obligation. cause. span,
252
+ E0271 ,
253
+ "type mismatch resolving `{}`" ,
254
+ predicate
249
255
) ;
250
256
self . note_type_err ( & mut diag, & obligation. cause , None , values, err) ;
251
257
self . note_obligation_cause ( & mut diag, obligation) ;
@@ -532,23 +538,33 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
532
538
/// whose result could not be truly determined and thus we can't say
533
539
/// if the program type checks or not -- and they are unusual
534
540
/// occurrences in any case.
535
- pub fn report_overflow_error < T > ( & self ,
536
- obligation : & Obligation < ' tcx , T > ,
537
- suggest_increasing_limit : bool ) -> !
541
+ pub fn report_overflow_error < T > (
542
+ & self ,
543
+ obligation : & Obligation < ' tcx , T > ,
544
+ suggest_increasing_limit : bool ,
545
+ ) -> !
538
546
where T : fmt:: Display + TypeFoldable < ' tcx >
539
547
{
540
548
let predicate =
541
549
self . resolve_vars_if_possible ( & obligation. predicate ) ;
542
- let mut err = struct_span_err ! ( self . tcx. sess, obligation. cause. span, E0275 ,
543
- "overflow evaluating the requirement `{}`" ,
544
- predicate) ;
550
+ let mut err = struct_span_err ! (
551
+ self . tcx. sess,
552
+ obligation. cause. span,
553
+ E0275 ,
554
+ "overflow evaluating the requirement `{}`" ,
555
+ predicate
556
+ ) ;
545
557
546
558
if suggest_increasing_limit {
547
559
self . suggest_new_overflow_limit ( & mut err) ;
548
560
}
549
561
550
- self . note_obligation_cause_code ( & mut err, & obligation. predicate , & obligation. cause . code ,
551
- & mut vec ! [ ] ) ;
562
+ self . note_obligation_cause_code (
563
+ & mut err,
564
+ & obligation. predicate ,
565
+ & obligation. cause . code ,
566
+ & mut vec ! [ ] ,
567
+ ) ;
552
568
553
569
err. emit ( ) ;
554
570
self . tcx . sess . abort_if_errors ( ) ;
0 commit comments