Skip to content

Commit 7bc220b

Browse files
committed
Simplify report_erroneous_element
1 parent 8b8a618 commit 7bc220b

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

compiler/rustc_borrowck/src/diagnostics/bound_region_errors.rs

+2-14
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,6 @@ impl<'tcx> UniverseInfo<'tcx> {
5555
placeholder: ty::PlaceholderRegion,
5656
cause: ObligationCause<'tcx>,
5757
error_element: Option<ty::PlaceholderRegion>,
58-
) {
59-
if let UniverseInfo::TypeOp(ref type_op_info) = *self {
60-
type_op_info.report_erroneous_element(mbcx, placeholder, cause, error_element);
61-
} else {
62-
self.report_generic_error(mbcx, cause);
63-
}
64-
}
65-
66-
fn report_generic_error(
67-
&self,
68-
mbcx: &mut MirBorrowckCtxt<'_, '_, 'tcx>,
69-
cause: ObligationCause<'tcx>,
7058
) {
7159
match *self {
7260
UniverseInfo::RelateTys { expected, found } => {
@@ -79,8 +67,8 @@ impl<'tcx> UniverseInfo<'tcx> {
7967
);
8068
mbcx.buffer_error(err);
8169
}
82-
UniverseInfo::TypeOp(_) => {
83-
unreachable!("This case should already have been handled!");
70+
UniverseInfo::TypeOp(ref type_op_info) => {
71+
type_op_info.report_erroneous_element(mbcx, placeholder, cause, error_element);
8472
}
8573
UniverseInfo::Other => {
8674
// FIXME: This error message isn't great, but it doesn't show

0 commit comments

Comments
 (0)