Skip to content

Commit ac9c8c1

Browse files
committed
Avoid ICEs
1 parent 8395dbd commit ac9c8c1

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

src/librustc/traits/codegen/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
153153
// contains unbound type parameters. It could be a slight
154154
// optimization to stop iterating early.
155155
if let Err(errors) = fulfill_cx.select_all_or_error(self) {
156-
span_bug!(span, "Encountered errors `{:?}` resolving bounds after type-checking",
157-
errors);
156+
debug!("Encountered errors `{:?}` resolving bounds after type-checking", errors);
157+
self.report_fulfillment_errors(&errors, None, false);
158158
}
159159

160160
let result = self.resolve_type_vars_if_possible(result);

src/librustc_mir/hair/pattern/check_match.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,9 @@ fn check_legality_of_move_bindings(
603603
E0009,
604604
"cannot bind by-move and by-ref in the same pattern",
605605
);
606-
err.span_label(by_ref_span.unwrap(), "both by-ref and by-move used");
606+
if let Some(by_ref_span) = by_ref_span {
607+
err.span_label(by_ref_span, "both by-ref and by-move used");
608+
}
607609
for span in span_vec.iter(){
608610
err.span_label(*span, "by-move pattern here");
609611
}

src/test/ui/consts/match_ice.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//~ ERROR can't compare `S` with `S`
12
// https://github.com/rust-lang/rust/issues/53708
23

34
struct S;

src/test/ui/consts/match_ice.stderr

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
error[E0004]: non-exhaustive patterns: `&S` not covered
2-
--> $DIR/match_ice.rs:7:11
2+
--> $DIR/match_ice.rs:8:11
33
|
44
LL | match C {
55
| ^ pattern `&S` not covered
66
|
77
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
88

9-
error: aborting due to previous error
9+
error[E0277]: can't compare `S` with `S`
10+
|
11+
= help: the trait `std::cmp::PartialEq` is not implemented for `S`
12+
= note: required because of the requirements on the impl of `std::cmp::PartialEq` for `&S`
13+
14+
error: aborting due to 2 previous errors
1015

11-
For more information about this error, try `rustc --explain E0004`.
16+
Some errors occurred: E0004, E0277.
17+
For more information about an error, try `rustc --explain E0004`.

0 commit comments

Comments
 (0)