1
- use crate :: infer:: canonical:: { Canonical , Canonicalized , CanonicalizedQueryResponse , QueryResponse } ;
1
+ use crate :: infer:: canonical:: { Canonicalized , CanonicalizedQueryResponse } ;
2
2
use std:: fmt;
3
3
use crate :: traits:: query:: Fallible ;
4
4
use crate :: ty:: fold:: TypeFoldable ;
@@ -38,25 +38,13 @@ where
38
38
) -> Fallible < CanonicalizedQueryResponse < ' tcx , Self :: QueryResponse > > {
39
39
T :: type_op_method ( tcx, canonicalized)
40
40
}
41
-
42
- fn shrink_to_tcx_lifetime (
43
- v : & ' a CanonicalizedQueryResponse < ' tcx , T > ,
44
- ) -> & ' a Canonical < ' tcx , QueryResponse < ' tcx , T > > {
45
- T :: shrink_to_tcx_lifetime ( v)
46
- }
47
41
}
48
42
49
43
pub trait Normalizable < ' tcx > : fmt:: Debug + TypeFoldable < ' tcx > + Lift < ' tcx > + Copy {
50
44
fn type_op_method (
51
45
tcx : TyCtxt < ' tcx > ,
52
46
canonicalized : Canonicalized < ' tcx , ParamEnvAnd < ' tcx , Normalize < Self > > > ,
53
47
) -> Fallible < CanonicalizedQueryResponse < ' tcx , Self > > ;
54
-
55
- /// Converts from the `'tcx` (lifted) form of `Self` into the `tcx`
56
- /// form of `Self`.
57
- fn shrink_to_tcx_lifetime (
58
- v : & ' a CanonicalizedQueryResponse < ' tcx , Self > ,
59
- ) -> & ' a Canonical < ' tcx , QueryResponse < ' tcx , Self > > ;
60
48
}
61
49
62
50
impl Normalizable < ' tcx > for Ty < ' tcx > {
@@ -66,12 +54,6 @@ impl Normalizable<'tcx> for Ty<'tcx> {
66
54
) -> Fallible < CanonicalizedQueryResponse < ' tcx , Self > > {
67
55
tcx. type_op_normalize_ty ( canonicalized)
68
56
}
69
-
70
- fn shrink_to_tcx_lifetime (
71
- v : & ' a CanonicalizedQueryResponse < ' tcx , Self > ,
72
- ) -> & ' a Canonical < ' tcx , QueryResponse < ' tcx , Self > > {
73
- v
74
- }
75
57
}
76
58
77
59
impl Normalizable < ' tcx > for ty:: Predicate < ' tcx > {
@@ -81,12 +63,6 @@ impl Normalizable<'tcx> for ty::Predicate<'tcx> {
81
63
) -> Fallible < CanonicalizedQueryResponse < ' tcx , Self > > {
82
64
tcx. type_op_normalize_predicate ( canonicalized)
83
65
}
84
-
85
- fn shrink_to_tcx_lifetime (
86
- v : & ' a CanonicalizedQueryResponse < ' tcx , Self > ,
87
- ) -> & ' a Canonical < ' tcx , QueryResponse < ' tcx , Self > > {
88
- v
89
- }
90
66
}
91
67
92
68
impl Normalizable < ' tcx > for ty:: PolyFnSig < ' tcx > {
@@ -96,12 +72,6 @@ impl Normalizable<'tcx> for ty::PolyFnSig<'tcx> {
96
72
) -> Fallible < CanonicalizedQueryResponse < ' tcx , Self > > {
97
73
tcx. type_op_normalize_poly_fn_sig ( canonicalized)
98
74
}
99
-
100
- fn shrink_to_tcx_lifetime (
101
- v : & ' a CanonicalizedQueryResponse < ' tcx , Self > ,
102
- ) -> & ' a Canonical < ' tcx , QueryResponse < ' tcx , Self > > {
103
- v
104
- }
105
75
}
106
76
107
77
impl Normalizable < ' tcx > for ty:: FnSig < ' tcx > {
@@ -111,12 +81,6 @@ impl Normalizable<'tcx> for ty::FnSig<'tcx> {
111
81
) -> Fallible < CanonicalizedQueryResponse < ' tcx , Self > > {
112
82
tcx. type_op_normalize_fn_sig ( canonicalized)
113
83
}
114
-
115
- fn shrink_to_tcx_lifetime (
116
- v : & ' a CanonicalizedQueryResponse < ' tcx , Self > ,
117
- ) -> & ' a Canonical < ' tcx , QueryResponse < ' tcx , Self > > {
118
- v
119
- }
120
84
}
121
85
122
86
BraceStructTypeFoldableImpl ! {
0 commit comments