]>
Commit | Line | Data |
---|---|---|
9c376795 | 1 | use crate::infer::canonical::{Canonical, CanonicalQueryResponse}; |
9fa01778 | 2 | use crate::traits::query::Fallible; |
ba9703b0 | 3 | use rustc_middle::ty::{ParamEnvAnd, TyCtxt}; |
8faf50e0 | 4 | |
ba9703b0 | 5 | pub use rustc_middle::traits::query::type_op::Eq; |
8faf50e0 | 6 | |
dc9dc135 | 7 | impl<'tcx> super::QueryTypeOp<'tcx> for Eq<'tcx> { |
0bf4aa26 | 8 | type QueryResponse = (); |
8faf50e0 XL |
9 | |
10 | fn try_fast_path( | |
dc9dc135 | 11 | _tcx: TyCtxt<'tcx>, |
8faf50e0 | 12 | key: &ParamEnvAnd<'tcx, Eq<'tcx>>, |
0bf4aa26 | 13 | ) -> Option<Self::QueryResponse> { |
dfeec247 | 14 | if key.value.a == key.value.b { Some(()) } else { None } |
8faf50e0 XL |
15 | } |
16 | ||
17 | fn perform_query( | |
dc9dc135 | 18 | tcx: TyCtxt<'tcx>, |
9c376795 FG |
19 | canonicalized: Canonical<'tcx, ParamEnvAnd<'tcx, Self>>, |
20 | ) -> Fallible<CanonicalQueryResponse<'tcx, ()>> { | |
8faf50e0 XL |
21 | tcx.type_op_eq(canonicalized) |
22 | } | |
8faf50e0 | 23 | } |