Skip to content

Commit

Permalink
Auto merge of #121676 - Bryanskiy:polarity, r=petrochenkov
Browse files Browse the repository at this point in the history
Support ?Trait bounds in supertraits and dyn Trait under a feature gate

This patch allows `maybe` polarity bounds under a feature gate. The only language change here is that corresponding hard errors are replaced by feature gates. Example:
```rust
#![feature(allow_maybe_polarity)]
...
trait Trait1 : ?Trait { ... } // ok
fn foo(_: Box<(dyn Trait2 + ?Trait)>) {} // ok
fn bar<T: ?Sized + ?Trait>(_: &T) {} // ok
```
Maybe bounds still don't do anything (except for `Sized` trait), however this patch will allow us to [experiment with default auto traits](rust-lang/rust#120706 (comment)).

This is a part of the [MCP: Low level components for async drop](rust-lang/compiler-team#727)
  • Loading branch information
bors committed Jul 26, 2024
2 parents c434ad5 + c8b4e1c commit 579c5b3
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 579c5b3

Please sign in to comment.