Skip to content

Commit

Permalink
Formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TommasoBianchi committed Dec 16, 2019
1 parent 042d855 commit b08d697
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/librustc_typeck/check/dropck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ pub fn check_drop_impl(tcx: TyCtxt<'_>, drop_impl_did: DefId) -> Result<(), Erro
// already checked by coherence, but compilation may
// not have been terminated.
let span = tcx.def_span(drop_impl_did);
tcx.sess.delay_span_bug(span,
&format!("should have been rejected by coherence check: {}", dtor_self_type));
tcx.sess.delay_span_bug(
span,
&format!("should have been rejected by coherence check: {}", dtor_self_type),
);
Err(ErrorReported)
}
}
Expand Down Expand Up @@ -85,10 +87,7 @@ fn ensure_drop_params_and_item_params_correspond<'tcx>(
let fresh_impl_self_ty = drop_impl_ty.subst(tcx, fresh_impl_substs);

let cause = &ObligationCause::misc(drop_impl_span, drop_impl_hir_id);
match infcx
.at(cause, impl_param_env)
.eq(named_type, fresh_impl_self_ty)
{
match infcx.at(cause, impl_param_env).eq(named_type, fresh_impl_self_ty) {
Ok(InferOk { obligations, .. }) => {
fulfillment_cx.register_predicate_obligations(infcx, obligations);
}
Expand All @@ -99,12 +98,13 @@ fn ensure_drop_params_and_item_params_correspond<'tcx>(
drop_impl_span,
E0366,
"Implementations of Drop cannot be specialized"
).span_note(
)
.span_note(
item_span,
"Use same sequence of generic type and region \
parameters that is on the struct/enum definition",
)
.emit();
.emit();
return Err(ErrorReported);
}
}
Expand Down Expand Up @@ -245,12 +245,13 @@ fn ensure_drop_predicates_are_implied_by_item_defn<'tcx>(
E0367,
"The requirement `{}` is added only by the Drop impl.",
predicate
).span_note(
)
.span_note(
item_span,
"The same requirement must be part of \
the struct/enum definition",
)
.emit();
.emit();
result = Err(ErrorReported);
}
}
Expand Down

0 comments on commit b08d697

Please sign in to comment.