]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_trait_selection/src/traits/query/type_op/subtype.rs
Auto merge of #104824 - klensy:bump-some, r=Mark-Simulacrum
[rust.git] / compiler / rustc_trait_selection / src / traits / query / type_op / subtype.rs
1 use crate::infer::canonical::{Canonicalized, CanonicalizedQueryResponse};
2 use crate::traits::query::Fallible;
3 use rustc_middle::ty::{ParamEnvAnd, TyCtxt};
4
5 pub use rustc_middle::traits::query::type_op::Subtype;
6
7 impl<'tcx> super::QueryTypeOp<'tcx> for Subtype<'tcx> {
8     type QueryResponse = ();
9
10     fn try_fast_path(_tcx: TyCtxt<'tcx>, key: &ParamEnvAnd<'tcx, Self>) -> Option<()> {
11         if key.value.sub == key.value.sup { Some(()) } else { None }
12     }
13
14     fn perform_query(
15         tcx: TyCtxt<'tcx>,
16         canonicalized: Canonicalized<'tcx, ParamEnvAnd<'tcx, Self>>,
17     ) -> Fallible<CanonicalizedQueryResponse<'tcx, ()>> {
18         tcx.type_op_subtype(canonicalized)
19     }
20 }