Skip Equate relation in handle_opaque_type
This commit is contained in:
parent
4136b59b7d
commit
5b96e5e71a
1 changed files with 3 additions and 10 deletions
|
@ -7,6 +7,7 @@ use rustc_data_structures::sync::Lrc;
|
||||||
use rustc_data_structures::vec_map::VecMap;
|
use rustc_data_structures::vec_map::VecMap;
|
||||||
use rustc_hir as hir;
|
use rustc_hir as hir;
|
||||||
use rustc_middle::traits::ObligationCause;
|
use rustc_middle::traits::ObligationCause;
|
||||||
|
use rustc_middle::ty::error::{ExpectedFound, TypeError};
|
||||||
use rustc_middle::ty::fold::BottomUpFolder;
|
use rustc_middle::ty::fold::BottomUpFolder;
|
||||||
use rustc_middle::ty::GenericArgKind;
|
use rustc_middle::ty::GenericArgKind;
|
||||||
use rustc_middle::ty::{
|
use rustc_middle::ty::{
|
||||||
|
@ -176,16 +177,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
||||||
} else if let Some(res) = process(b, a) {
|
} else if let Some(res) = process(b, a) {
|
||||||
res
|
res
|
||||||
} else {
|
} else {
|
||||||
// Rerun equality check, but this time error out due to
|
let (a, b) = self.resolve_vars_if_possible((a, b));
|
||||||
// different types.
|
Err(TypeError::Sorts(ExpectedFound::new(true, a, b)))
|
||||||
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),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue