1
Fork 0

Rollup merge of #110791 - compiler-errors:negative-bounds, r=oli-obk

Implement negative bounds for internal testing purposes

Implements partial support the `!` negative polarity on trait bounds. This is incomplete, but should allow us to at least be able to play with the feature.

Not even gonna consider them as a public-facing feature, but I'm implementing them because would've been nice to have in UI tests, for example in #110671.
This commit is contained in:
Dylan DPC 2023-05-04 00:17:23 +05:30 committed by GitHub
commit 80df4ab403
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 481 additions and 188 deletions

View file

@ -606,7 +606,7 @@ impl<'a> Parser<'a> {
let kind = if self.eat(&token::Colon) {
// Parse associated type constraint bound.
let bounds = self.parse_generic_bounds(Some(self.prev_token.span))?;
let bounds = self.parse_generic_bounds()?;
AssocConstraintKind::Bound { bounds }
} else if self.eat(&token::Eq) {
self.parse_assoc_equality_term(ident, self.prev_token.span)?