]> git.proxmox.com Git - rustc.git/blob - src/librustc_trait_selection/traits/query/type_op/ascribe_user_type.rs
New upstream version 1.47.0+dfsg1
[rustc.git] / src / librustc_trait_selection / 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 }