Remove SelectionContext::allow_negative_impls field
This commit is contained in:
parent
ad88732254
commit
bd51f174ed
2 changed files with 2 additions and 26 deletions
|
@ -119,11 +119,6 @@ pub struct SelectionContext<'cx, 'tcx> {
|
|||
|
||||
intercrate_ambiguity_causes: Option<Vec<IntercrateAmbiguityCause>>,
|
||||
|
||||
/// Controls whether or not to filter out negative impls when selecting.
|
||||
/// This is used in librustdoc to distinguish between the lack of an impl
|
||||
/// and a negative impl
|
||||
allow_negative_impls: bool,
|
||||
|
||||
/// The mode that trait queries run in, which informs our error handling
|
||||
/// policy. In essence, canonicalized queries need their errors propagated
|
||||
/// rather than immediately reported because we do not have accurate spans.
|
||||
|
@ -215,7 +210,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
freshener: infcx.freshener_keep_static(),
|
||||
intercrate: false,
|
||||
intercrate_ambiguity_causes: None,
|
||||
allow_negative_impls: false,
|
||||
query_mode: TraitQueryMode::Standard,
|
||||
}
|
||||
}
|
||||
|
@ -226,22 +220,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
freshener: infcx.freshener_keep_static(),
|
||||
intercrate: true,
|
||||
intercrate_ambiguity_causes: None,
|
||||
allow_negative_impls: false,
|
||||
query_mode: TraitQueryMode::Standard,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn with_negative(
|
||||
infcx: &'cx InferCtxt<'cx, 'tcx>,
|
||||
allow_negative_impls: bool,
|
||||
) -> SelectionContext<'cx, 'tcx> {
|
||||
debug!(?allow_negative_impls, "with_negative");
|
||||
SelectionContext {
|
||||
infcx,
|
||||
freshener: infcx.freshener_keep_static(),
|
||||
intercrate: false,
|
||||
intercrate_ambiguity_causes: None,
|
||||
allow_negative_impls,
|
||||
query_mode: TraitQueryMode::Standard,
|
||||
}
|
||||
}
|
||||
|
@ -256,7 +234,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
freshener: infcx.freshener_keep_static(),
|
||||
intercrate: false,
|
||||
intercrate_ambiguity_causes: None,
|
||||
allow_negative_impls: false,
|
||||
query_mode,
|
||||
}
|
||||
}
|
||||
|
@ -1192,7 +1169,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
if let ImplCandidate(def_id) = candidate {
|
||||
if ty::ImplPolarity::Reservation == tcx.impl_polarity(def_id)
|
||||
|| obligation.polarity() == tcx.impl_polarity(def_id)
|
||||
|| self.allow_negative_impls
|
||||
{
|
||||
result.push(candidate);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue