Skip to content

Commit dfe8aff

Browse files
committed
Deduplicate failing type tests by their original lower bounds
1 parent 1144f9e commit dfe8aff

File tree

1 file changed

+6
-1
lines changed
  • compiler/rustc_borrowck/src/region_infer

1 file changed

+6
-1
lines changed

compiler/rustc_borrowck/src/region_infer/mod.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,11 +742,16 @@ impl<'tcx> RegionInferenceContext<'tcx> {
742742

743743
// Type-test failed. Report the error.
744744
let erased_generic_kind = infcx.tcx.erase_regions(type_test.generic_kind);
745+
let original_lower_bound = type_test
746+
.original
747+
.as_ref()
748+
.map(|original| original.lower_bound)
749+
.unwrap_or(type_test.lower_bound);
745750

746751
// Skip duplicate-ish errors.
747752
if deduplicate_errors.insert((
748753
erased_generic_kind,
749-
type_test.lower_bound,
754+
original_lower_bound,
750755
type_test.span,
751756
)) {
752757
debug!(

0 commit comments

Comments
 (0)