Vendor dependencies

Let's see how I like this workflow.
This commit is contained in:
John Doty 2022-12-19 08:27:18 -08:00
parent 34d1830413
commit 9c435dc440
7500 changed files with 1665121 additions and 99 deletions

View file

@ -0,0 +1,15 @@
use pin_project_lite::pin_project;
pin_project! { //~ ERROR E0119
struct Foo<T, U> {
#[pin]
future: T,
field: U,
}
}
impl<T, U> Drop for Foo<T, U> {
fn drop(&mut self) {}
}
fn main() {}

View file

@ -0,0 +1,16 @@
error[E0119]: conflicting implementations of trait `_::MustNotImplDrop` for type `Foo<_, _>`
--> tests/ui/pin_project/conflict-drop.rs:3:1
|
3 | / pin_project! { //~ ERROR E0119
4 | | struct Foo<T, U> {
5 | | #[pin]
6 | | future: T,
7 | | field: U,
8 | | }
9 | | }
| | ^
| | |
| |_first implementation here
| conflicting implementation for `Foo<_, _>`
|
= note: this error originates in the macro `$crate::__pin_project_make_drop_impl` (in Nightly builds, run with -Z macro-backtrace for more info)

View file

@ -0,0 +1,40 @@
use pin_project_lite::pin_project;
// The same implementation.
pin_project! { //~ ERROR E0119
struct Foo<T, U> {
#[pin]
future: T,
field: U,
}
}
// conflicting implementations
impl<T, U> Unpin for Foo<T, U> where T: Unpin {} // Conditional Unpin impl
// The implementation that under different conditions.
pin_project! { //~ ERROR E0119
struct Bar<T, U> {
#[pin]
future: T,
field: U,
}
}
// conflicting implementations
impl<T, U> Unpin for Bar<T, U> {} // Non-conditional Unpin impl
pin_project! { //~ ERROR E0119
struct Baz<T, U> {
#[pin]
future: T,
field: U,
}
}
// conflicting implementations
impl<T: Unpin, U: Unpin> Unpin for Baz<T, U> {} // Conditional Unpin impl
fn main() {}

View file

@ -0,0 +1,50 @@
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>`
--> tests/ui/pin_project/conflict-unpin.rs:5:1
|
5 | / pin_project! { //~ ERROR E0119
6 | | struct Foo<T, U> {
7 | | #[pin]
8 | | future: T,
9 | | field: U,
10 | | }
11 | | }
| |_^ conflicting implementation for `Foo<_, _>`
...
14 | impl<T, U> Unpin for Foo<T, U> where T: Unpin {} // Conditional Unpin impl
| --------------------------------------------- first implementation here
|
= note: this error originates in the macro `$crate::__pin_project_make_unpin_impl` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Bar<_, _>`
--> tests/ui/pin_project/conflict-unpin.rs:18:1
|
18 | / pin_project! { //~ ERROR E0119
19 | | struct Bar<T, U> {
20 | | #[pin]
21 | | future: T,
22 | | field: U,
23 | | }
24 | | }
| |_^ conflicting implementation for `Bar<_, _>`
...
27 | impl<T, U> Unpin for Bar<T, U> {} // Non-conditional Unpin impl
| ------------------------------ first implementation here
|
= note: this error originates in the macro `$crate::__pin_project_make_unpin_impl` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Baz<_, _>`
--> tests/ui/pin_project/conflict-unpin.rs:29:1
|
29 | / pin_project! { //~ ERROR E0119
30 | | struct Baz<T, U> {
31 | | #[pin]
32 | | future: T,
33 | | field: U,
34 | | }
35 | | }
| |_^ conflicting implementation for `Baz<_, _>`
...
38 | impl<T: Unpin, U: Unpin> Unpin for Baz<T, U> {} // Conditional Unpin impl
| -------------------------------------------- first implementation here
|
= note: this error originates in the macro `$crate::__pin_project_make_unpin_impl` (in Nightly builds, run with -Z macro-backtrace for more info)

View file

@ -0,0 +1,93 @@
use pin_project_lite::pin_project;
pin_project! {
struct Generics1<T: 'static : Sized> { //~ ERROR no rules expected the token `:`
field: T,
}
}
pin_project! {
struct Generics2<T: 'static : ?Sized> { //~ ERROR no rules expected the token `:`
field: T,
}
}
pin_project! {
struct Generics3<T: Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
field: T,
}
}
pin_project! {
struct Generics4<T: ?Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
field: T,
}
}
pin_project! {
struct Generics5<T: Sized : ?Sized> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
field: T,
}
}
pin_project! {
struct Generics6<T: ?Sized : Sized> { //~ ERROR no rules expected the token `Sized`
field: T,
}
}
pin_project! {
struct WhereClause1<T>
where
T: 'static : Sized //~ ERROR no rules expected the token `:`
{
field: T,
}
}
pin_project! {
struct WhereClause2<T>
where
T: 'static : ?Sized //~ ERROR no rules expected the token `:`
{
field: T,
}
}
pin_project! {
struct WhereClause3<T>
where
T: Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
{
field: T,
}
}
pin_project! {
struct WhereClause4<T>
where
T: ?Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
{
field: T,
}
}
pin_project! {
struct WhereClause5<T>
where
T: Sized : ?Sized //~ ERROR expected `where`, or `{` after struct name, found `:`
{
field: T,
}
}
pin_project! {
struct WhereClause6<T>
where
T: ?Sized : Sized //~ ERROR no rules expected the token `Sized`
{
field: T,
}
}
fn main() {}

View file

@ -0,0 +1,428 @@
error: no rules expected the token `:`
--> tests/ui/pin_project/invalid-bounds.rs:4:33
|
4 | struct Generics1<T: 'static : Sized> { //~ ERROR no rules expected the token `:`
| ^ no rules expected this token in macro call
error: no rules expected the token `:`
--> tests/ui/pin_project/invalid-bounds.rs:10:33
|
10 | struct Generics2<T: 'static : ?Sized> { //~ ERROR no rules expected the token `:`
| ^ no rules expected this token in macro call
error: expected one of `+`, `,`, `=`, or `>`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:15:1
|
15 | / pin_project! {
16 | | struct Generics3<T: Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
17 | | field: T,
18 | | }
19 | | }
| | ^
| | |
| | expected one of `+`, `,`, `=`, or `>`
| |_unexpected token
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected one of `+`, `,`, `=`, or `>`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:15:1
|
15 | / pin_project! {
16 | | struct Generics3<T: Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
17 | | field: T,
18 | | }
19 | | }
| | ^
| | |
| |_expected one of `+`, `,`, `=`, or `>`
| unexpected token
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected one of `+`, `,`, `=`, or `>`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:15:1
|
15 | / pin_project! {
16 | | struct Generics3<T: Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
17 | | field: T,
18 | | }
19 | | }
| | ^
| | |
| | expected one of `+`, `,`, `=`, or `>`
| |_unexpected token
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected one of `+`, `,`, `=`, or `>`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:15:1
|
15 | / pin_project! {
16 | | struct Generics3<T: Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
17 | | field: T,
18 | | }
19 | | }
| | ^
| | |
| | expected one of `+`, `,`, `=`, or `>`
| |_unexpected token
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected one of `+`, `,`, `=`, or `>`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:21:1
|
21 | / pin_project! {
22 | | struct Generics4<T: ?Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
23 | | field: T,
24 | | }
25 | | }
| | ^
| | |
| | expected one of `+`, `,`, `=`, or `>`
| |_unexpected token
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected one of `+`, `,`, `=`, or `>`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:21:1
|
21 | / pin_project! {
22 | | struct Generics4<T: ?Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
23 | | field: T,
24 | | }
25 | | }
| | ^
| | |
| |_expected one of `+`, `,`, `=`, or `>`
| unexpected token
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected one of `+`, `,`, `=`, or `>`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:21:1
|
21 | / pin_project! {
22 | | struct Generics4<T: ?Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
23 | | field: T,
24 | | }
25 | | }
| | ^
| | |
| | expected one of `+`, `,`, `=`, or `>`
| |_unexpected token
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected one of `+`, `,`, `=`, or `>`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:21:1
|
21 | / pin_project! {
22 | | struct Generics4<T: ?Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
23 | | field: T,
24 | | }
25 | | }
| | ^
| | |
| | expected one of `+`, `,`, `=`, or `>`
| |_unexpected token
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected one of `+`, `,`, `=`, or `>`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:27:1
|
27 | / pin_project! {
28 | | struct Generics5<T: Sized : ?Sized> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
29 | | field: T,
30 | | }
31 | | }
| | ^
| | |
| | expected one of `+`, `,`, `=`, or `>`
| |_unexpected token
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected one of `+`, `,`, `=`, or `>`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:27:1
|
27 | / pin_project! {
28 | | struct Generics5<T: Sized : ?Sized> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
29 | | field: T,
30 | | }
31 | | }
| | ^
| | |
| |_expected one of `+`, `,`, `=`, or `>`
| unexpected token
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected one of `+`, `,`, `=`, or `>`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:27:1
|
27 | / pin_project! {
28 | | struct Generics5<T: Sized : ?Sized> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
29 | | field: T,
30 | | }
31 | | }
| | ^
| | |
| | expected one of `+`, `,`, `=`, or `>`
| |_unexpected token
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected one of `+`, `,`, `=`, or `>`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:27:1
|
27 | / pin_project! {
28 | | struct Generics5<T: Sized : ?Sized> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
29 | | field: T,
30 | | }
31 | | }
| | ^
| | |
| | expected one of `+`, `,`, `=`, or `>`
| |_unexpected token
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info)
error: no rules expected the token `Sized`
--> tests/ui/pin_project/invalid-bounds.rs:34:34
|
34 | struct Generics6<T: ?Sized : Sized> { //~ ERROR no rules expected the token `Sized`
| ^^^^^ no rules expected this token in macro call
error: no rules expected the token `:`
--> tests/ui/pin_project/invalid-bounds.rs:42:20
|
42 | T: 'static : Sized //~ ERROR no rules expected the token `:`
| ^ no rules expected this token in macro call
error: no rules expected the token `:`
--> tests/ui/pin_project/invalid-bounds.rs:51:20
|
51 | T: 'static : ?Sized //~ ERROR no rules expected the token `:`
| ^ no rules expected this token in macro call
error: expected `{` after struct name, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:57:1
|
57 | / pin_project! {
58 | | struct WhereClause3<T>
59 | | where
60 | | T: Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
63 | | }
64 | | }
| | ^
| | |
| |_expected `{` after struct name
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected one of `+`, `,`, or `{`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:57:1
|
57 | / pin_project! {
58 | | struct WhereClause3<T>
59 | | where
60 | | T: Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
63 | | }
64 | | }
| | ^
| | |
| |_expected one of `+`, `,`, or `{`
| unexpected token
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `{` after struct name, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:57:1
|
57 | / pin_project! {
58 | | struct WhereClause3<T>
59 | | where
60 | | T: Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
63 | | }
64 | | }
| | ^
| | |
| |_expected `{` after struct name
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `{` after struct name, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:57:1
|
57 | / pin_project! {
58 | | struct WhereClause3<T>
59 | | where
60 | | T: Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
63 | | }
64 | | }
| | ^
| | |
| |_expected `{` after struct name
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `{` after struct name, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:66:1
|
66 | / pin_project! {
67 | | struct WhereClause4<T>
68 | | where
69 | | T: ?Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
72 | | }
73 | | }
| | ^
| | |
| |_expected `{` after struct name
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected one of `+`, `,`, or `{`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:66:1
|
66 | / pin_project! {
67 | | struct WhereClause4<T>
68 | | where
69 | | T: ?Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
72 | | }
73 | | }
| | ^
| | |
| |_expected one of `+`, `,`, or `{`
| unexpected token
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `{` after struct name, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:66:1
|
66 | / pin_project! {
67 | | struct WhereClause4<T>
68 | | where
69 | | T: ?Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
72 | | }
73 | | }
| | ^
| | |
| |_expected `{` after struct name
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `{` after struct name, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:66:1
|
66 | / pin_project! {
67 | | struct WhereClause4<T>
68 | | where
69 | | T: ?Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
72 | | }
73 | | }
| | ^
| | |
| |_expected `{` after struct name
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `{` after struct name, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:75:1
|
75 | / pin_project! {
76 | | struct WhereClause5<T>
77 | | where
78 | | T: Sized : ?Sized //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
81 | | }
82 | | }
| | ^
| | |
| |_expected `{` after struct name
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected one of `+`, `,`, or `{`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:75:1
|
75 | / pin_project! {
76 | | struct WhereClause5<T>
77 | | where
78 | | T: Sized : ?Sized //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
81 | | }
82 | | }
| | ^
| | |
| |_expected one of `+`, `,`, or `{`
| unexpected token
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `{` after struct name, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:75:1
|
75 | / pin_project! {
76 | | struct WhereClause5<T>
77 | | where
78 | | T: Sized : ?Sized //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
81 | | }
82 | | }
| | ^
| | |
| |_expected `{` after struct name
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `{` after struct name, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:75:1
|
75 | / pin_project! {
76 | | struct WhereClause5<T>
77 | | where
78 | | T: Sized : ?Sized //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
81 | | }
82 | | }
| | ^
| | |
| |_expected `{` after struct name
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` (in Nightly builds, run with -Z macro-backtrace for more info)
error: no rules expected the token `Sized`
--> tests/ui/pin_project/invalid-bounds.rs:87:21
|
87 | T: ?Sized : Sized //~ ERROR no rules expected the token `Sized`
| ^^^^^ no rules expected this token in macro call

View file

@ -0,0 +1,25 @@
use pin_project_lite::pin_project;
pin_project! {
struct A<T> {
#[pin()] //~ ERROR no rules expected the token `(`
pinned: T,
}
}
pin_project! {
#[pin] //~ ERROR cannot find attribute `pin` in this scope
struct B<T> {
pinned: T,
}
}
pin_project! {
struct C<T> {
#[pin]
#[pin] //~ ERROR no rules expected the token `#`
pinned: T,
}
}
fn main() {}

View file

@ -0,0 +1,59 @@
error: no rules expected the token `struct`
--> tests/ui/pin_project/invalid.rs:3:1
|
3 | / pin_project! {
4 | | struct A<T> {
5 | | #[pin()] //~ ERROR no rules expected the token `(`
6 | | pinned: T,
7 | | }
8 | | }
| |_^ no rules expected this token in macro call
|
= note: this error originates in the macro `$crate::__pin_project_expand` (in Nightly builds, run with -Z macro-backtrace for more info)
error: no rules expected the token `struct`
--> tests/ui/pin_project/invalid.rs:3:1
|
3 | / pin_project! {
4 | | struct A<T> {
5 | | #[pin()] //~ ERROR no rules expected the token `(`
6 | | pinned: T,
7 | | }
8 | | }
| |_^ no rules expected this token in macro call
|
= note: this error originates in the macro `$crate::__pin_project_expand` (in Nightly builds, run with -Z macro-backtrace for more info)
error: no rules expected the token `struct`
--> tests/ui/pin_project/invalid.rs:17:1
|
17 | / pin_project! {
18 | | struct C<T> {
19 | | #[pin]
20 | | #[pin] //~ ERROR no rules expected the token `#`
21 | | pinned: T,
22 | | }
23 | | }
| |_^ no rules expected this token in macro call
|
= note: this error originates in the macro `$crate::__pin_project_expand` (in Nightly builds, run with -Z macro-backtrace for more info)
error: no rules expected the token `struct`
--> tests/ui/pin_project/invalid.rs:17:1
|
17 | / pin_project! {
18 | | struct C<T> {
19 | | #[pin]
20 | | #[pin] //~ ERROR no rules expected the token `#`
21 | | pinned: T,
22 | | }
23 | | }
| |_^ no rules expected this token in macro call
|
= note: this error originates in the macro `$crate::__pin_project_expand` (in Nightly builds, run with -Z macro-backtrace for more info)
error: cannot find attribute `pin` in this scope
--> tests/ui/pin_project/invalid.rs:11:7
|
11 | #[pin] //~ ERROR cannot find attribute `pin` in this scope
| ^^^

View file

@ -0,0 +1,10 @@
use pin_project_lite::pin_project;
pin_project! { //~ ERROR E0263,E0496
pub struct Foo<'__pin, T> {
#[pin]
field: &'__pin mut T,
}
}
fn main() {}

View file

@ -0,0 +1,75 @@
error[E0263]: lifetime name `'__pin` declared twice in the same scope
--> tests/ui/pin_project/overlapping_lifetime_names.rs:4:20
|
3 | / pin_project! { //~ ERROR E0263,E0496
4 | | pub struct Foo<'__pin, T> {
| | ^^^^^^ declared twice
5 | | #[pin]
6 | | field: &'__pin mut T,
7 | | }
8 | | }
| |_- previous declaration here
error[E0263]: lifetime name `'__pin` declared twice in the same scope
--> tests/ui/pin_project/overlapping_lifetime_names.rs:4:20
|
3 | / pin_project! { //~ ERROR E0263,E0496
4 | | pub struct Foo<'__pin, T> {
| | ^^^^^^ declared twice
5 | | #[pin]
6 | | field: &'__pin mut T,
7 | | }
8 | | }
| |_- previous declaration here
error[E0263]: lifetime name `'__pin` declared twice in the same scope
--> tests/ui/pin_project/overlapping_lifetime_names.rs:4:20
|
3 | / pin_project! { //~ ERROR E0263,E0496
4 | | pub struct Foo<'__pin, T> {
| | ^^^^^^ declared twice
5 | | #[pin]
6 | | field: &'__pin mut T,
7 | | }
8 | | }
| |_- previous declaration here
error[E0496]: lifetime name `'__pin` shadows a lifetime name that is already in scope
--> tests/ui/pin_project/overlapping_lifetime_names.rs:3:1
|
3 | / pin_project! { //~ ERROR E0263,E0496
4 | | pub struct Foo<'__pin, T> {
| | ------ first declared here
5 | | #[pin]
6 | | field: &'__pin mut T,
7 | | }
8 | | }
| |_^ lifetime `'__pin` already in scope
|
= note: this error originates in the macro `$crate::__pin_project_struct_make_proj_method` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0496]: lifetime name `'__pin` shadows a lifetime name that is already in scope
--> tests/ui/pin_project/overlapping_lifetime_names.rs:3:1
|
3 | / pin_project! { //~ ERROR E0263,E0496
4 | | pub struct Foo<'__pin, T> {
| | ------ first declared here
5 | | #[pin]
6 | | field: &'__pin mut T,
7 | | }
8 | | }
| |_^ lifetime `'__pin` already in scope
|
= note: this error originates in the macro `$crate::__pin_project_struct_make_proj_method` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0263]: lifetime name `'__pin` declared twice in the same scope
--> tests/ui/pin_project/overlapping_lifetime_names.rs:4:20
|
3 | / pin_project! { //~ ERROR E0263,E0496
4 | | pub struct Foo<'__pin, T> {
| | ^^^^^^ declared twice
5 | | #[pin]
6 | | field: &'__pin mut T,
7 | | }
8 | | }
| |_- previous declaration here

View file

@ -0,0 +1,20 @@
use std::marker::PhantomPinned;
use pin_project_lite::pin_project;
pin_project! {
struct Foo<T> {
#[pin]
inner: T,
}
}
struct __Origin {}
impl Unpin for __Origin {}
fn is_unpin<T: Unpin>() {}
fn main() {
is_unpin::<Foo<PhantomPinned>>(); //~ ERROR E0277
}

View file

@ -0,0 +1,33 @@
error[E0277]: `PhantomPinned` cannot be unpinned
--> tests/ui/pin_project/overlapping_unpin_struct.rs:19:5
|
19 | is_unpin::<Foo<PhantomPinned>>(); //~ ERROR E0277
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `_::__Origin<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned`
|
= note: consider using `Box::pin`
note: required because it appears within the type `_::__Origin<'_, PhantomPinned>`
--> tests/ui/pin_project/overlapping_unpin_struct.rs:5:1
|
5 | / pin_project! {
6 | | struct Foo<T> {
7 | | #[pin]
8 | | inner: T,
9 | | }
10 | | }
| |_^
note: required because of the requirements on the impl of `Unpin` for `Foo<PhantomPinned>`
--> tests/ui/pin_project/overlapping_unpin_struct.rs:5:1
|
5 | / pin_project! {
6 | | struct Foo<T> {
7 | | #[pin]
8 | | inner: T,
9 | | }
10 | | }
| |_^
note: required by a bound in `is_unpin`
--> tests/ui/pin_project/overlapping_unpin_struct.rs:16:16
|
16 | fn is_unpin<T: Unpin>() {}
| ^^^^^ required by this bound in `is_unpin`
= note: this error originates in the macro `$crate::__pin_project_make_unpin_impl` (in Nightly builds, run with -Z macro-backtrace for more info)

View file

@ -0,0 +1,21 @@
#![allow(unaligned_references)]
use pin_project_lite::pin_project;
pin_project! { //~ ERROR reference to packed field is unaligned
#[repr(packed, C)]
struct Packed {
#[pin]
field: u16,
}
}
pin_project! { //~ ERROR reference to packed field is unaligned
#[repr(packed(2))]
struct PackedN {
#[pin]
field: u32,
}
}
fn main() {}

View file

@ -0,0 +1,57 @@
error: reference to packed field is unaligned
--> tests/ui/pin_project/packed.rs:5:1
|
5 | / pin_project! { //~ ERROR reference to packed field is unaligned
6 | | #[repr(packed, C)]
7 | | struct Packed {
8 | | #[pin]
9 | | field: u16,
10 | | }
11 | | }
| |_^
|
note: the lint level is defined here
--> tests/ui/pin_project/packed.rs:5:1
|
5 | / pin_project! { //~ ERROR reference to packed field is unaligned
6 | | #[repr(packed, C)]
7 | | struct Packed {
8 | | #[pin]
9 | | field: u16,
10 | | }
11 | | }
| |_^
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
= note: this error originates in the macro `$crate::__pin_project_constant` (in Nightly builds, run with -Z macro-backtrace for more info)
error: reference to packed field is unaligned
--> tests/ui/pin_project/packed.rs:13:1
|
13 | / pin_project! { //~ ERROR reference to packed field is unaligned
14 | | #[repr(packed(2))]
15 | | struct PackedN {
16 | | #[pin]
17 | | field: u32,
18 | | }
19 | | }
| |_^
|
note: the lint level is defined here
--> tests/ui/pin_project/packed.rs:13:1
|
13 | / pin_project! { //~ ERROR reference to packed field is unaligned
14 | | #[repr(packed(2))]
15 | | struct PackedN {
16 | | #[pin]
17 | | field: u32,
18 | | }
19 | | }
| |_^
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
= note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
= help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
= note: this error originates in the macro `$crate::__pin_project_constant` (in Nightly builds, run with -Z macro-backtrace for more info)

View file

@ -0,0 +1,12 @@
use pin_project_lite::pin_project;
pin_project! {
struct Foo {
#[pin]
inner: u8,
}
}
impl Unpin for __Origin {} //~ ERROR E0412,E0321
fn main() {}

View file

@ -0,0 +1,11 @@
error[E0412]: cannot find type `__Origin` in this scope
--> tests/ui/pin_project/unpin_sneaky.rs:10:16
|
10 | impl Unpin for __Origin {} //~ ERROR E0412,E0321
| ^^^^^^^^ not found in this scope
error[E0321]: cross-crate traits with a default impl, like `Unpin`, can only be implemented for a struct/enum type, not `[type error]`
--> tests/ui/pin_project/unpin_sneaky.rs:10:1
|
10 | impl Unpin for __Origin {} //~ ERROR E0412,E0321
| ^^^^^^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait with a default impl for non-struct/enum type

View file

@ -0,0 +1,27 @@
use pin_project_lite::pin_project;
pin_project! {
struct Struct1 {} //~ ERROR no rules expected the token `}`
}
pin_project! {
struct Struct2(); //~ ERROR no rules expected the token `(`
}
pin_project! {
struct Struct3; //~ ERROR no rules expected the token `;`
}
pin_project! {
enum Enum { //~ ERROR no rules expected the token `enum`
A(u8)
}
}
pin_project! {
union Union { //~ ERROR no rules expected the token `union`
x: u8,
}
}
fn main() {}

View file

@ -0,0 +1,79 @@
error: no rules expected the token `}`
--> tests/ui/pin_project/unsupported.rs:3:1
|
3 | / pin_project! {
4 | | struct Struct1 {} //~ ERROR no rules expected the token `}`
5 | | }
| |_^ no rules expected this token in macro call
|
= note: this error originates in the macro `$crate::__pin_project_expand` (in Nightly builds, run with -Z macro-backtrace for more info)
error: no rules expected the token `}`
--> tests/ui/pin_project/unsupported.rs:3:1
|
3 | / pin_project! {
4 | | struct Struct1 {} //~ ERROR no rules expected the token `}`
5 | | }
| |_^ no rules expected this token in macro call
|
= note: this error originates in the macro `$crate::__pin_project_expand` (in Nightly builds, run with -Z macro-backtrace for more info)
error: no rules expected the token `(`
--> tests/ui/pin_project/unsupported.rs:8:19
|
8 | struct Struct2(); //~ ERROR no rules expected the token `(`
| ^ no rules expected this token in macro call
error: no rules expected the token `;`
--> tests/ui/pin_project/unsupported.rs:12:19
|
12 | struct Struct3; //~ ERROR no rules expected the token `;`
| ^ no rules expected this token in macro call
error: no rules expected the token `enum`
--> tests/ui/pin_project/unsupported.rs:15:1
|
15 | / pin_project! {
16 | | enum Enum { //~ ERROR no rules expected the token `enum`
17 | | A(u8)
18 | | }
19 | | }
| |_^ no rules expected this token in macro call
|
= note: this error originates in the macro `$crate::__pin_project_expand` (in Nightly builds, run with -Z macro-backtrace for more info)
error: no rules expected the token `enum`
--> tests/ui/pin_project/unsupported.rs:15:1
|
15 | / pin_project! {
16 | | enum Enum { //~ ERROR no rules expected the token `enum`
17 | | A(u8)
18 | | }
19 | | }
| |_^ no rules expected this token in macro call
|
= note: this error originates in the macro `$crate::__pin_project_expand` (in Nightly builds, run with -Z macro-backtrace for more info)
error: no rules expected the token `union`
--> tests/ui/pin_project/unsupported.rs:21:1
|
21 | / pin_project! {
22 | | union Union { //~ ERROR no rules expected the token `union`
23 | | x: u8,
24 | | }
25 | | }
| |_^ no rules expected this token in macro call
|
= note: this error originates in the macro `$crate::__pin_project_expand` (in Nightly builds, run with -Z macro-backtrace for more info)
error: no rules expected the token `union`
--> tests/ui/pin_project/unsupported.rs:21:1
|
21 | / pin_project! {
22 | | union Union { //~ ERROR no rules expected the token `union`
23 | | x: u8,
24 | | }
25 | | }
| |_^ no rules expected this token in macro call
|
= note: this error originates in the macro `$crate::__pin_project_expand` (in Nightly builds, run with -Z macro-backtrace for more info)