@@ -119,11 +119,6 @@ pub struct SelectionContext<'cx, 'tcx> {
119
119
120
120
intercrate_ambiguity_causes : Option < Vec < IntercrateAmbiguityCause > > ,
121
121
122
- /// Controls whether or not to filter out negative impls when selecting.
123
- /// This is used in librustdoc to distinguish between the lack of an impl
124
- /// and a negative impl
125
- allow_negative_impls : bool ,
126
-
127
122
/// The mode that trait queries run in, which informs our error handling
128
123
/// policy. In essence, canonicalized queries need their errors propagated
129
124
/// rather than immediately reported because we do not have accurate spans.
@@ -215,7 +210,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
215
210
freshener : infcx. freshener_keep_static ( ) ,
216
211
intercrate : false ,
217
212
intercrate_ambiguity_causes : None ,
218
- allow_negative_impls : false ,
219
213
query_mode : TraitQueryMode :: Standard ,
220
214
}
221
215
}
@@ -226,22 +220,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
226
220
freshener : infcx. freshener_keep_static ( ) ,
227
221
intercrate : true ,
228
222
intercrate_ambiguity_causes : None ,
229
- allow_negative_impls : false ,
230
- query_mode : TraitQueryMode :: Standard ,
231
- }
232
- }
233
-
234
- pub fn with_negative (
235
- infcx : & ' cx InferCtxt < ' cx , ' tcx > ,
236
- allow_negative_impls : bool ,
237
- ) -> SelectionContext < ' cx , ' tcx > {
238
- debug ! ( ?allow_negative_impls, "with_negative" ) ;
239
- SelectionContext {
240
- infcx,
241
- freshener : infcx. freshener_keep_static ( ) ,
242
- intercrate : false ,
243
- intercrate_ambiguity_causes : None ,
244
- allow_negative_impls,
245
223
query_mode : TraitQueryMode :: Standard ,
246
224
}
247
225
}
@@ -256,7 +234,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
256
234
freshener : infcx. freshener_keep_static ( ) ,
257
235
intercrate : false ,
258
236
intercrate_ambiguity_causes : None ,
259
- allow_negative_impls : false ,
260
237
query_mode,
261
238
}
262
239
}
@@ -1192,7 +1169,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
1192
1169
if let ImplCandidate ( def_id) = candidate {
1193
1170
if ty:: ImplPolarity :: Reservation == tcx. impl_polarity ( def_id)
1194
1171
|| obligation. polarity ( ) == tcx. impl_polarity ( def_id)
1195
- || self . allow_negative_impls
1196
1172
{
1197
1173
result. push ( candidate) ;
1198
1174
}
0 commit comments