Skip to content

Commit

Permalink
Rollup merge of rust-lang#102069 - compiler-errors:no-eq-in-register-…
Browse files Browse the repository at this point in the history
…opaque, r=oli-obk

Skip `Equate` relation in `handle_opaque_type`

r? `@oli-obk`
  • Loading branch information
Dylan-DPC authored Sep 22, 2022
2 parents 8110cce + 5b96e5e commit 2d7dd56
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 2d7dd56

Please sign in to comment.