@@ -16,11 +16,25 @@ use rustc::traits::query::type_op::prove_predicate::ProvePredicate;
1616use rustc:: traits:: query:: type_op:: subtype:: Subtype ;
1717use rustc:: traits:: query:: { Fallible , NoSolution } ;
1818use rustc:: traits:: { Obligation , Normalized , ObligationCause } ;
19+ use rustc:: ty:: query:: Providers ;
1920use rustc:: ty:: { FnSig , Lift , PolyFnSig , Predicate , Ty , TyCtxt , TypeFoldable } ;
2021use rustc_data_structures:: sync:: Lrc ;
2122use std:: fmt;
2223
23- crate fn type_op_eq < ' tcx > (
24+ crate fn provide ( p : & mut Providers ) {
25+ * p = Providers {
26+ type_op_eq,
27+ type_op_prove_predicate,
28+ type_op_subtype,
29+ type_op_normalize_ty,
30+ type_op_normalize_predicate,
31+ type_op_normalize_fn_sig,
32+ type_op_normalize_poly_fn_sig,
33+ ..* p
34+ } ;
35+ }
36+
37+ fn type_op_eq < ' tcx > (
2438 tcx : TyCtxt < ' _ , ' tcx , ' tcx > ,
2539 canonicalized : Canonical < ' tcx , Eq < ' tcx > > ,
2640) -> Result < Lrc < Canonical < ' tcx , QueryResult < ' tcx , ( ) > > > , NoSolution > {
@@ -44,39 +58,39 @@ where
4458 Ok ( InferOk { value, obligations } ) // ugh we should merge these two structs
4559}
4660
47- crate fn type_op_normalize_ty (
61+ fn type_op_normalize_ty (
4862 tcx : TyCtxt < ' _ , ' tcx , ' tcx > ,
4963 canonicalized : Canonical < ' tcx , Normalize < ' tcx , Ty < ' tcx > > > ,
5064) -> Result < Lrc < Canonical < ' tcx , QueryResult < ' tcx , Ty < ' tcx > > > > , NoSolution > {
5165 tcx. infer_ctxt ( )
5266 . enter_canonical_trait_query ( & canonicalized, type_op_normalize)
5367}
5468
55- crate fn type_op_normalize_predicate (
69+ fn type_op_normalize_predicate (
5670 tcx : TyCtxt < ' _ , ' tcx , ' tcx > ,
5771 canonicalized : Canonical < ' tcx , Normalize < ' tcx , Predicate < ' tcx > > > ,
5872) -> Result < Lrc < Canonical < ' tcx , QueryResult < ' tcx , Predicate < ' tcx > > > > , NoSolution > {
5973 tcx. infer_ctxt ( )
6074 . enter_canonical_trait_query ( & canonicalized, type_op_normalize)
6175}
6276
63- crate fn type_op_normalize_fn_sig (
77+ fn type_op_normalize_fn_sig (
6478 tcx : TyCtxt < ' _ , ' tcx , ' tcx > ,
6579 canonicalized : Canonical < ' tcx , Normalize < ' tcx , FnSig < ' tcx > > > ,
6680) -> Result < Lrc < Canonical < ' tcx , QueryResult < ' tcx , FnSig < ' tcx > > > > , NoSolution > {
6781 tcx. infer_ctxt ( )
6882 . enter_canonical_trait_query ( & canonicalized, type_op_normalize)
6983}
7084
71- crate fn type_op_normalize_poly_fn_sig (
85+ fn type_op_normalize_poly_fn_sig (
7286 tcx : TyCtxt < ' _ , ' tcx , ' tcx > ,
7387 canonicalized : Canonical < ' tcx , Normalize < ' tcx , PolyFnSig < ' tcx > > > ,
7488) -> Result < Lrc < Canonical < ' tcx , QueryResult < ' tcx , PolyFnSig < ' tcx > > > > , NoSolution > {
7589 tcx. infer_ctxt ( )
7690 . enter_canonical_trait_query ( & canonicalized, type_op_normalize)
7791}
7892
79- crate fn type_op_subtype < ' tcx > (
93+ fn type_op_subtype < ' tcx > (
8094 tcx : TyCtxt < ' _ , ' tcx , ' tcx > ,
8195 canonicalized : Canonical < ' tcx , Subtype < ' tcx > > ,
8296) -> Result < Lrc < Canonical < ' tcx , QueryResult < ' tcx , ( ) > > > , NoSolution > {
@@ -95,7 +109,7 @@ crate fn type_op_subtype<'tcx>(
95109 )
96110}
97111
98- crate fn type_op_prove_predicate < ' tcx > (
112+ fn type_op_prove_predicate < ' tcx > (
99113 tcx : TyCtxt < ' _ , ' tcx , ' tcx > ,
100114 canonicalized : Canonical < ' tcx , ProvePredicate < ' tcx > > ,
101115) -> Result < Lrc < Canonical < ' tcx , QueryResult < ' tcx , ( ) > > > , NoSolution > {
0 commit comments