@@ -107,38 +107,6 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> {
107
107
& mut query_state,
108
108
)
109
109
}
110
-
111
- /// A hacky variant of `canonicalize_query` that does not
112
- /// canonicalize `'static`. Unfortunately, the existing leak
113
- /// check treats `'static` differently in some cases (see also
114
- /// #33684), so if we are performing an operation that may need to
115
- /// prove "leak-check" related things, we leave `'static`
116
- /// alone.
117
- ///
118
- /// `'static` is also special cased when winnowing candidates when
119
- /// selecting implementation candidates, so we also have to leave `'static`
120
- /// alone for queries that do selection.
121
- //
122
- // FIXME(#48536): once the above issues are resolved, we can remove this
123
- // and just use `canonicalize_query`.
124
- pub fn canonicalize_hr_query_hack < V > (
125
- & self ,
126
- value : & V ,
127
- query_state : & mut OriginalQueryValues < ' tcx > ,
128
- ) -> Canonicalized < ' tcx , V >
129
- where
130
- V : TypeFoldable < ' tcx > ,
131
- {
132
- self . tcx . sess . perf_stats . queries_canonicalized . fetch_add ( 1 , Ordering :: Relaxed ) ;
133
-
134
- Canonicalizer :: canonicalize (
135
- value,
136
- Some ( self ) ,
137
- self . tcx ,
138
- & CanonicalizeFreeRegionsOtherThanStatic ,
139
- query_state,
140
- )
141
- }
142
110
}
143
111
144
112
/// Controls how we canonicalize "free regions" that are not inference
@@ -254,26 +222,6 @@ impl CanonicalizeRegionMode for CanonicalizeAllFreeRegions {
254
222
}
255
223
}
256
224
257
- struct CanonicalizeFreeRegionsOtherThanStatic ;
258
-
259
- impl CanonicalizeRegionMode for CanonicalizeFreeRegionsOtherThanStatic {
260
- fn canonicalize_free_region (
261
- & self ,
262
- canonicalizer : & mut Canonicalizer < ' _ , ' tcx > ,
263
- r : ty:: Region < ' tcx > ,
264
- ) -> ty:: Region < ' tcx > {
265
- if let ty:: ReStatic = r {
266
- r
267
- } else {
268
- canonicalizer. canonical_var_for_region_in_root_universe ( r)
269
- }
270
- }
271
-
272
- fn any ( & self ) -> bool {
273
- true
274
- }
275
- }
276
-
277
225
struct Canonicalizer < ' cx , ' tcx > {
278
226
infcx : Option < & ' cx InferCtxt < ' cx , ' tcx > > ,
279
227
tcx : TyCtxt < ' tcx > ,
0 commit comments