Skip to content

Commit cbd994b

Browse files
committed
Drive-by formatting
1 parent 0b0563c commit cbd994b

File tree

1 file changed

+31
-15
lines changed

1 file changed

+31
-15
lines changed

src/librustc/traits/error_reporting.rs

+31-15
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
195195
obligation: &PredicateObligation<'tcx>,
196196
error: &MismatchedProjectionTypes<'tcx>,
197197
) {
198-
let predicate =
199-
self.resolve_vars_if_possible(&obligation.predicate);
198+
let predicate = self.resolve_vars_if_possible(&obligation.predicate);
200199

201200
if predicate.references_error() {
202201
return
@@ -228,7 +227,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
228227
&mut obligations
229228
);
230229
if let Err(error) = self.at(&obligation.cause, obligation.param_env)
231-
.eq(normalized_ty, data.ty) {
230+
.eq(normalized_ty, data.ty)
231+
{
232232
values = Some(infer::ValuePairs::Types(ExpectedFound {
233233
expected: normalized_ty,
234234
found: data.ty,
@@ -239,13 +239,19 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
239239
}
240240

241241
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+
);
244247
let fresh = self.tcx.sess.one_time_diagnostics.borrow_mut().insert(error_id);
245248
if fresh {
246249
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
249255
);
250256
self.note_type_err(&mut diag, &obligation.cause, None, values, err);
251257
self.note_obligation_cause(&mut diag, obligation);
@@ -532,23 +538,33 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
532538
/// whose result could not be truly determined and thus we can't say
533539
/// if the program type checks or not -- and they are unusual
534540
/// 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+
) -> !
538546
where T: fmt::Display + TypeFoldable<'tcx>
539547
{
540548
let predicate =
541549
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+
);
545557

546558
if suggest_increasing_limit {
547559
self.suggest_new_overflow_limit(&mut err);
548560
}
549561

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+
);
552568

553569
err.emit();
554570
self.tcx.sess.abort_if_errors();

0 commit comments

Comments
 (0)