Skip to content

Commit

Permalink
Skip Equate relation in handle_opaque_type
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Sep 20, 2022
1 parent 4136b59 commit 5b96e5e
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions compiler/rustc_infer/src/infer/opaque_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use rustc_data_structures::sync::Lrc;
use rustc_data_structures::vec_map::VecMap;
use rustc_hir as hir;
use rustc_middle::traits::ObligationCause;
use rustc_middle::ty::error::{ExpectedFound, TypeError};
use rustc_middle::ty::fold::BottomUpFolder;
use rustc_middle::ty::GenericArgKind;
use rustc_middle::ty::{
Expand Down Expand Up @@ -176,16 +177,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
} else if let Some(res) = process(b, a) {
res
} else {
// Rerun equality check, but this time error out due to
// different types.
match self.at(cause, param_env).define_opaque_types(false).eq(a, b) {
Ok(_) => span_bug!(
cause.span,
"opaque types are never equal to anything but themselves: {:#?}",
(a.kind(), b.kind())
),
Err(e) => Err(e),
}
let (a, b) = self.resolve_vars_if_possible((a, b));
Err(TypeError::Sorts(ExpectedFound::new(true, a, b)))
}
}

Expand Down

0 comments on commit 5b96e5e

Please sign in to comment.