-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support ?Sized bounds in generic parameters
- Loading branch information
Showing
4 changed files
with
84 additions
and
32 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
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,15 @@ | ||
use pin_project_lite::pin_project; | ||
|
||
pin_project! { | ||
struct A<T: 'static : ?Sized> { //~ ERROR no rules expected the token `:` | ||
field: T, | ||
} | ||
} | ||
|
||
pin_project! { | ||
struct B<T: Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:` | ||
field: T, | ||
} | ||
} | ||
|
||
fn main() {} |
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,21 @@ | ||
error: no rules expected the token `:` | ||
--> $DIR/invalid-bounds.rs:4:25 | ||
| | ||
4 | struct A<T: 'static : ?Sized> { //~ ERROR no rules expected the token `:` | ||
| ^ no rules expected this token in macro call | ||
|
||
error: expected one of `+`, `,`, `=`, or `>`, found `:` | ||
--> $DIR/invalid-bounds.rs:9:1 | ||
| | ||
9 | / pin_project! { | ||
10 | | struct B<T: Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:` | ||
11 | | field: T, | ||
12 | | } | ||
13 | | } | ||
| | ^ | ||
| | | | ||
| | expected one of `+`, `,`, `=`, or `>` | ||
| |_unexpected token | ||
| in this macro invocation | ||
| | ||
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) |