forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#67148 - Centril:ty-polish, r=estebank
Refactor type & bounds parsing thoroughly PR is based on rust-lang#67131 with first one from this PR being ` extract parse_ty_tuple_or_parens`. Also fixes rust-lang#67146. r? @estebank
- Loading branch information
Showing
11 changed files
with
370 additions
and
285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
error: negative trait bounds are not supported | ||
error: negative bounds are not supported | ||
--> $DIR/issue-58857.rs:4:7 | ||
| | ||
LL | impl<A: !Valid> Conj<A>{} | ||
| ^^^^^^^^ negative trait bounds are not supported | ||
| | ||
= help: remove the trait bound | ||
| ^^^^^^^^ negative bounds are not supported | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,36 @@ | ||
error: negative trait bounds are not supported | ||
error: negative bounds are not supported | ||
--> $DIR/issue-33418.rs:3:9 | ||
| | ||
LL | trait Tr: !SuperA {} | ||
| ^^^^^^^^^ negative trait bounds are not supported | ||
| | ||
= help: remove the trait bound | ||
| ^^^^^^^^^ negative bounds are not supported | ||
|
||
error: negative trait bounds are not supported | ||
error: negative bounds are not supported | ||
--> $DIR/issue-33418.rs:5:19 | ||
| | ||
LL | trait Tr2: SuperA + !SuperB {} | ||
| ^^^^^^^^^ negative trait bounds are not supported | ||
| | ||
= help: remove the trait bound | ||
| ^^^^^^^^^ negative bounds are not supported | ||
|
||
error: negative trait bounds are not supported | ||
error: negative bounds are not supported | ||
--> $DIR/issue-33418.rs:7:10 | ||
| | ||
LL | trait Tr3: !SuperA + SuperB {} | ||
| ^^^^^^^^^ negative trait bounds are not supported | ||
| | ||
= help: remove the trait bound | ||
| ^^^^^^^^^ negative bounds are not supported | ||
|
||
error: negative trait bounds are not supported | ||
error: negative bounds are not supported | ||
--> $DIR/issue-33418.rs:9:10 | ||
| | ||
LL | trait Tr4: !SuperA + SuperB | ||
| ^^^^^^^^^ | ||
LL | + !SuperC + SuperD {} | ||
| ^^^^^^^^^ negative trait bounds are not supported | ||
| | ||
= help: remove the trait bounds | ||
| ^^^^^^^^^ negative bounds are not supported | ||
|
||
error: negative trait bounds are not supported | ||
error: negative bounds are not supported | ||
--> $DIR/issue-33418.rs:12:10 | ||
| | ||
LL | trait Tr5: !SuperA | ||
| ^^^^^^^^^ | ||
LL | + !SuperB {} | ||
| ^^^^^^^^^ negative trait bounds are not supported | ||
| | ||
= help: remove the trait bounds | ||
| ^^^^^^^^^ negative bounds are not supported | ||
|
||
error: aborting due to 5 previous errors | ||
|
12 changes: 12 additions & 0 deletions
12
src/test/ui/parser/issue-67146-negative-outlives-bound-syntactic-fail.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// In this regression test for #67146, we check that the | ||
// negative outlives bound `!'a` is rejected by the parser. | ||
// This regression was first introduced in PR #57364. | ||
|
||
fn main() {} | ||
|
||
fn f1<T: !'static>() {} | ||
//~^ ERROR negative bounds are not supported | ||
fn f2<'a, T: Ord + !'a>() {} | ||
//~^ ERROR negative bounds are not supported | ||
fn f3<'a, T: !'a + Ord>() {} | ||
//~^ ERROR negative bounds are not supported |
20 changes: 20 additions & 0 deletions
20
src/test/ui/parser/issue-67146-negative-outlives-bound-syntactic-fail.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
error: negative bounds are not supported | ||
--> $DIR/issue-67146-negative-outlives-bound-syntactic-fail.rs:7:8 | ||
| | ||
LL | fn f1<T: !'static>() {} | ||
| ^^^^^^^^^^ negative bounds are not supported | ||
|
||
error: negative bounds are not supported | ||
--> $DIR/issue-67146-negative-outlives-bound-syntactic-fail.rs:9:18 | ||
| | ||
LL | fn f2<'a, T: Ord + !'a>() {} | ||
| ^^^^^ negative bounds are not supported | ||
|
||
error: negative bounds are not supported | ||
--> $DIR/issue-67146-negative-outlives-bound-syntactic-fail.rs:11:12 | ||
| | ||
LL | fn f3<'a, T: !'a + Ord>() {} | ||
| ^^^^^ negative bounds are not supported | ||
|
||
error: aborting due to 3 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters