about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-07-27 07:29:00 +0000
committerbors <bors@rust-lang.org>2023-07-27 07:29:00 +0000
commit2efa46dc159b2b4717eff487e2b653c263476aa9 (patch)
tree43541636f302a93b26cd15d999bb05b060253114
parent3e11b223d7ad9836babf2d531b0ca6d13ff3f065 (diff)
parent808e174dfc8e6921fa9aac71ae6e568e940687af (diff)
downloadrust-2efa46dc159b2b4717eff487e2b653c263476aa9.tar.gz
rust-2efa46dc159b2b4717eff487e2b653c263476aa9.zip
Auto merge of #114080 - compiler-errors:negative, r=spastorino
Don't treat negative trait predicates as always knowable

We don't need this. It was added in #90104 but I don't really know why. It's not sound afaict -- negative trait predicates need the same coherence-ambiguity/orphan check rules as positive ones.

r? `@lcnr`

cc `@spastorino,` do you remember why?
-rw-r--r--compiler/rustc_trait_selection/src/traits/select/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs
index e086489b1bc..ca289ab6fe3 100644
--- a/compiler/rustc_trait_selection/src/traits/select/mod.rs
+++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs
@@ -1487,7 +1487,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
     fn is_knowable<'o>(&mut self, stack: &TraitObligationStack<'o, 'tcx>) -> Result<(), Conflict> {
         debug!("is_knowable(intercrate={:?})", self.is_intercrate());
 
-        if !self.is_intercrate() || stack.obligation.polarity() == ty::ImplPolarity::Negative {
+        if !self.is_intercrate() {
             return Ok(());
         }