]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_trait_selection/src/traits/query/type_op/ascribe_user_type.rs
Rollup merge of #102854 - semarie:openbsd-immutablestack, r=m-ou-se
[rust.git] / compiler / rustc_trait_selection / src / traits / query / type_op / ascribe_user_type.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::AscribeUserType;
6
7 impl<'tcx> super::QueryTypeOp<'tcx> for AscribeUserType<'tcx> {
8     type QueryResponse = ();
9
10     fn try_fast_path(
11         _tcx: TyCtxt<'tcx>,
12         _key: &ParamEnvAnd<'tcx, Self>,
13     ) -> Option<Self::QueryResponse> {
14         None
15     }
16
17     fn perform_query(
18         tcx: TyCtxt<'tcx>,
19         canonicalized: Canonicalized<'tcx, ParamEnvAnd<'tcx, Self>>,
20     ) -> Fallible<CanonicalizedQueryResponse<'tcx, ()>> {
21         tcx.type_op_ascribe_user_type(canonicalized)
22     }
23 }