diff --git a/src/librustc/traits/codegen/mod.rs b/src/librustc/traits/codegen/mod.rs index 9b0a3820c859c..c0cfdb58aaa1e 100644 --- a/src/librustc/traits/codegen/mod.rs +++ b/src/librustc/traits/codegen/mod.rs @@ -153,8 +153,8 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { // contains unbound type parameters. It could be a slight // optimization to stop iterating early. if let Err(errors) = fulfill_cx.select_all_or_error(self) { - span_bug!(span, "Encountered errors `{:?}` resolving bounds after type-checking", - errors); + debug!("Encountered errors `{:?}` resolving bounds after type-checking", errors); + self.report_fulfillment_errors(&errors, None, false); } let result = self.resolve_type_vars_if_possible(result); diff --git a/src/librustc_mir/hair/pattern/check_match.rs b/src/librustc_mir/hair/pattern/check_match.rs index 7ded973701edc..3afd00bf52806 100644 --- a/src/librustc_mir/hair/pattern/check_match.rs +++ b/src/librustc_mir/hair/pattern/check_match.rs @@ -603,7 +603,9 @@ fn check_legality_of_move_bindings( E0009, "cannot bind by-move and by-ref in the same pattern", ); - err.span_label(by_ref_span.unwrap(), "both by-ref and by-move used"); + if let Some(by_ref_span) = by_ref_span { + err.span_label(by_ref_span, "both by-ref and by-move used"); + } for span in span_vec.iter(){ err.span_label(*span, "by-move pattern here"); } diff --git a/src/test/ui/consts/match_ice.rs b/src/test/ui/consts/match_ice.rs index 53c5782a4c70e..3e8c4d5dd5839 100644 --- a/src/test/ui/consts/match_ice.rs +++ b/src/test/ui/consts/match_ice.rs @@ -1,3 +1,4 @@ +//~ ERROR can't compare `S` with `S` // https://github.com/rust-lang/rust/issues/53708 struct S; diff --git a/src/test/ui/consts/match_ice.stderr b/src/test/ui/consts/match_ice.stderr index e238fad431831..64f0503242459 100644 --- a/src/test/ui/consts/match_ice.stderr +++ b/src/test/ui/consts/match_ice.stderr @@ -1,11 +1,17 @@ error[E0004]: non-exhaustive patterns: `&S` not covered - --> $DIR/match_ice.rs:7:11 + --> $DIR/match_ice.rs:8:11 | LL | match C { | ^ pattern `&S` not covered | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms -error: aborting due to previous error +error[E0277]: can't compare `S` with `S` + | + = help: the trait `std::cmp::PartialEq` is not implemented for `S` + = note: required because of the requirements on the impl of `std::cmp::PartialEq` for `&S` + +error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0004`. +Some errors occurred: E0004, E0277. +For more information about an error, try `rustc --explain E0004`.