@@ -119,11 +119,6 @@ pub struct SelectionContext<'cx, 'tcx> {
119119
120120 intercrate_ambiguity_causes : Option < Vec < IntercrateAmbiguityCause > > ,
121121
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-
127122 /// The mode that trait queries run in, which informs our error handling
128123 /// policy. In essence, canonicalized queries need their errors propagated
129124 /// rather than immediately reported because we do not have accurate spans.
@@ -215,7 +210,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
215210 freshener : infcx. freshener_keep_static ( ) ,
216211 intercrate : false ,
217212 intercrate_ambiguity_causes : None ,
218- allow_negative_impls : false ,
219213 query_mode : TraitQueryMode :: Standard ,
220214 }
221215 }
@@ -226,22 +220,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
226220 freshener : infcx. freshener_keep_static ( ) ,
227221 intercrate : true ,
228222 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,
245223 query_mode : TraitQueryMode :: Standard ,
246224 }
247225 }
@@ -256,7 +234,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
256234 freshener : infcx. freshener_keep_static ( ) ,
257235 intercrate : false ,
258236 intercrate_ambiguity_causes : None ,
259- allow_negative_impls : false ,
260237 query_mode,
261238 }
262239 }
@@ -1192,7 +1169,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
11921169 if let ImplCandidate ( def_id) = candidate {
11931170 if ty:: ImplPolarity :: Reservation == tcx. impl_polarity ( def_id)
11941171 || obligation. polarity ( ) == tcx. impl_polarity ( def_id)
1195- || self . allow_negative_impls
11961172 {
11971173 result. push ( candidate) ;
11981174 }
@@ -1272,7 +1248,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
12721248 // the master cache. Since coherence executes pretty quickly,
12731249 // it's not worth going to more trouble to increase the
12741250 // hit-rate, I don't think.
1275- if self . intercrate || self . allow_negative_impls {
1251+ if self . intercrate {
12761252 return false ;
12771253 }
12781254
@@ -1289,7 +1265,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
12891265 // mode, so don't do any caching. In particular, we might
12901266 // re-use the same `InferCtxt` with both an intercrate
12911267 // and non-intercrate `SelectionContext`
1292- if self . intercrate || self . allow_negative_impls {
1268+ if self . intercrate {
12931269 return None ;
12941270 }
12951271 let tcx = self . tcx ( ) ;
0 commit comments