Skip to content

Commit 2efa46d

Browse files
committed
Auto merge of rust-lang#114080 - compiler-errors:negative, r=spastorino
Don't treat negative trait predicates as always knowable We don't need this. It was added in rust-lang#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?
2 parents 3e11b22 + 808e174 commit 2efa46d

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_trait_selection/src/traits/select

1 file changed

+1
-1
lines changed

compiler/rustc_trait_selection/src/traits/select/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1487,7 +1487,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
14871487
fn is_knowable<'o>(&mut self, stack: &TraitObligationStack<'o, 'tcx>) -> Result<(), Conflict> {
14881488
debug!("is_knowable(intercrate={:?})", self.is_intercrate());
14891489

1490-
if !self.is_intercrate() || stack.obligation.polarity() == ty::ImplPolarity::Negative {
1490+
if !self.is_intercrate() {
14911491
return Ok(());
14921492
}
14931493

0 commit comments

Comments
 (0)