Vendor dependencies for 0.3.0 release

This commit is contained in:
2025-09-27 10:29:08 -05:00
parent 0c8d39d483
commit 82ab7f317b
26803 changed files with 16134934 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
use pin_project_lite::pin_project;
pin_project! {
#[project(!Unpin)]
struct Foo<T, U> {
#[pin]
f1: T,
f2: U,
}
}
impl<T, U> Unpin for Foo<T, U> where T: Unpin {}
pin_project! {
#[project(!Unpin)]
struct Bar<T, U> {
#[pin]
f1: T,
f2: U,
}
}
impl<T, U> Unpin for Bar<T, U> {}
pin_project! {
#[project(!Unpin)]
struct Baz<T, U> {
#[pin]
f1: T,
f2: U,
}
}
impl<T: Unpin, U: Unpin> Unpin for Baz<T, U> {}
fn main() {}

View File

@@ -0,0 +1,50 @@
error[E0119]: conflicting implementations of trait `Unpin` for type `Foo<_, _>`
--> tests/ui/not_unpin/conflict-unpin.rs:5:1
|
5 | / pin_project! {
6 | | #[project(!Unpin)]
7 | | struct Foo<T, U> {
8 | | #[pin]
... |
12 | | }
| |_^ conflicting implementation for `Foo<_, _>`
13 |
14 | impl<T, U> Unpin for Foo<T, U> where T: Unpin {}
| --------------------------------------------- first implementation here
|
= note: upstream crates may add a new impl of trait `std::marker::Unpin` for type `(std::marker::PhantomData<&()>, std::marker::PhantomPinned)` in future versions
= note: this error originates in the macro `$crate::__pin_project_make_unpin_impl` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0119]: conflicting implementations of trait `Unpin` for type `Bar<_, _>`
--> tests/ui/not_unpin/conflict-unpin.rs:16:1
|
16 | / pin_project! {
17 | | #[project(!Unpin)]
18 | | struct Bar<T, U> {
19 | | #[pin]
... |
23 | | }
| |_^ conflicting implementation for `Bar<_, _>`
24 |
25 | impl<T, U> Unpin for Bar<T, U> {}
| ------------------------------ first implementation here
|
= note: upstream crates may add a new impl of trait `std::marker::Unpin` for type `(std::marker::PhantomData<&()>, std::marker::PhantomPinned)` in future versions
= note: this error originates in the macro `$crate::__pin_project_make_unpin_impl` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0119]: conflicting implementations of trait `Unpin` for type `Baz<_, _>`
--> tests/ui/not_unpin/conflict-unpin.rs:27:1
|
27 | / pin_project! {
28 | | #[project(!Unpin)]
29 | | struct Baz<T, U> {
30 | | #[pin]
... |
34 | | }
| |_^ conflicting implementation for `Baz<_, _>`
35 |
36 | impl<T: Unpin, U: Unpin> Unpin for Baz<T, U> {}
| -------------------------------------------- first implementation here
|
= note: upstream crates may add a new impl of trait `std::marker::Unpin` for type `(std::marker::PhantomData<&()>, std::marker::PhantomPinned)` in future versions
= note: this error originates in the macro `$crate::__pin_project_make_unpin_impl` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@@ -0,0 +1,22 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
// https://github.com/taiki-e/pin-project/issues/340#issuecomment-2428002670
pin_project_lite::pin_project! {
#[project(!Unpin)]
struct Foo<Pinned, Unpinned> {
#[pin]
pinned: Pinned,
unpinned: Unpinned,
}
}
struct MyPhantomPinned(::core::marker::PhantomPinned);
impl Unpin for MyPhantomPinned where for<'cursed> str: Sized {}
impl Unpin for Foo<MyPhantomPinned, ()> {}
fn is_unpin<T: Unpin>() {}
fn main() {
is_unpin::<Foo<MyPhantomPinned, ()>>()
}

View File

@@ -0,0 +1,16 @@
error[E0119]: conflicting implementations of trait `Unpin` for type `Foo<MyPhantomPinned, ()>`
--> tests/ui/not_unpin/negative_impls_stable.rs:5:1
|
5 | / pin_project_lite::pin_project! {
6 | | #[project(!Unpin)]
7 | | struct Foo<Pinned, Unpinned> {
8 | | #[pin]
... |
12 | | }
| |_^ conflicting implementation for `Foo<MyPhantomPinned, ()>`
...
16 | impl Unpin for Foo<MyPhantomPinned, ()> {}
| --------------------------------------- first implementation here
|
= note: upstream crates may add a new impl of trait `std::marker::Unpin` for type `(std::marker::PhantomData<&()>, std::marker::PhantomPinned)` in future versions
= note: this error originates in the macro `$crate::__pin_project_make_unpin_impl` which comes from the expansion of the macro `pin_project_lite::pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@@ -0,0 +1,17 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
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,15 @@
error[E0119]: conflicting implementations of trait `MustNotImplDrop` for type `Foo<_, _>`
--> tests/ui/pin_project/conflict-drop.rs:5:1
|
5 | / pin_project! { //~ ERROR E0119
6 | | struct Foo<T, U> {
7 | | #[pin]
8 | | future: T,
... |
11 | | }
| | ^
| | |
| |_first implementation here
| conflicting implementation for `Foo<_, _>`
|
= note: this error originates in the macro `$crate::__pin_project_make_drop_impl` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@@ -0,0 +1,66 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
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
pin_project! { //~ ERROR E0119
#[project(!Unpin)]
struct Qux<T, U> {
#[pin]
future: T,
field: U,
}
}
// conflicting implementations
impl<T, U> Unpin for Qux<T, U> {} // Non-conditional Unpin impl
pin_project! { //~ ERROR E0119
#[project(!Unpin)]
struct Fred<T, U> {
#[pin]
future: T,
field: U,
}
}
// conflicting implementations
impl<T: Unpin, U: Unpin> Unpin for Fred<T, U> {} // Conditional Unpin impl
fn main() {}

View File

@@ -0,0 +1,81 @@
error[E0119]: conflicting implementations of trait `Unpin` for type `Foo<_, _>`
--> tests/ui/pin_project/conflict-unpin.rs:7:1
|
7 | / pin_project! { //~ ERROR E0119
8 | | struct Foo<T, U> {
9 | | #[pin]
10 | | future: T,
... |
13 | | }
| |_^ conflicting implementation for `Foo<_, _>`
...
16 | 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` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0119]: conflicting implementations of trait `Unpin` for type `Bar<_, _>`
--> tests/ui/pin_project/conflict-unpin.rs:20:1
|
20 | / pin_project! { //~ ERROR E0119
21 | | struct Bar<T, U> {
22 | | #[pin]
23 | | future: T,
... |
26 | | }
| |_^ conflicting implementation for `Bar<_, _>`
...
29 | 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` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0119]: conflicting implementations of trait `Unpin` for type `Baz<_, _>`
--> tests/ui/pin_project/conflict-unpin.rs:31:1
|
31 | / pin_project! { //~ ERROR E0119
32 | | struct Baz<T, U> {
33 | | #[pin]
34 | | future: T,
... |
37 | | }
| |_^ conflicting implementation for `Baz<_, _>`
...
40 | 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` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0119]: conflicting implementations of trait `Unpin` for type `Qux<_, _>`
--> tests/ui/pin_project/conflict-unpin.rs:42:1
|
42 | / pin_project! { //~ ERROR E0119
43 | | #[project(!Unpin)]
44 | | struct Qux<T, U> {
45 | | #[pin]
... |
49 | | }
| |_^ conflicting implementation for `Qux<_, _>`
...
52 | impl<T, U> Unpin for Qux<T, U> {} // Non-conditional Unpin impl
| ------------------------------ first implementation here
|
= note: upstream crates may add a new impl of trait `std::marker::Unpin` for type `(std::marker::PhantomData<&()>, std::marker::PhantomPinned)` in future versions
= note: this error originates in the macro `$crate::__pin_project_make_unpin_impl` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0119]: conflicting implementations of trait `Unpin` for type `Fred<_, _>`
--> tests/ui/pin_project/conflict-unpin.rs:54:1
|
54 | / pin_project! { //~ ERROR E0119
55 | | #[project(!Unpin)]
56 | | struct Fred<T, U> {
57 | | #[pin]
... |
61 | | }
| |_^ conflicting implementation for `Fred<_, _>`
...
64 | impl<T: Unpin, U: Unpin> Unpin for Fred<T, U> {} // Conditional Unpin impl
| --------------------------------------------- first implementation here
|
= note: upstream crates may add a new impl of trait `std::marker::Unpin` for type `(std::marker::PhantomData<&()>, std::marker::PhantomPinned)` in future versions
= note: this error originates in the macro `$crate::__pin_project_make_unpin_impl` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@@ -0,0 +1,95 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
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,518 @@
error: no rules expected `:`
--> tests/ui/pin_project/invalid-bounds.rs:6:33
|
6 | struct Generics1<T: 'static : Sized> { //~ ERROR no rules expected the token `:`
| ^ no rules expected this token in macro call
|
note: while trying to match `>`
--> src/lib.rs
|
| >)?
| ^
error: no rules expected `:`
--> tests/ui/pin_project/invalid-bounds.rs:12:33
|
12 | struct Generics2<T: 'static : ?Sized> { //~ ERROR no rules expected the token `:`
| ^ no rules expected this token in macro call
|
note: while trying to match `>`
--> src/lib.rs
|
| >)?
| ^
error: expected one of `+`, `,`, `=`, or `>`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:17:1
|
17 | / pin_project! {
18 | | struct Generics3<T: Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
19 | | field: T,
20 | | }
21 | | }
| | ^
| | |
| | expected one of `+`, `,`, `=`, or `>`
| |_unexpected token
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
help: you might have meant to end the type parameters here
--> src/lib.rs
|
| $(: $generics_bound>)?
| +
error: expected one of `+`, `,`, `=`, or `>`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:17:1
|
17 | / pin_project! {
18 | | struct Generics3<T: Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
19 | | field: T,
20 | | }
21 | | }
| | ^
| | |
| |_expected one of `+`, `,`, `=`, or `>`
| unexpected token
|
= note: type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
help: you might have meant to end the type parameters here
--> src/lib.rs
|
| $(: $generics_bound>)?
| +
error: expected one of `+`, `,`, `=`, or `>`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:17:1
|
17 | / pin_project! {
18 | | struct Generics3<T: Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
19 | | field: T,
20 | | }
21 | | }
| | ^
| | |
| | expected one of `+`, `,`, `=`, or `>`
| |_unexpected token
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
help: you might have meant to end the type parameters here
--> src/lib.rs
|
| $(: $generics_bound>)?
| +
error: expected one of `+`, `,`, `=`, or `>`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:17:1
|
17 | / pin_project! {
18 | | struct Generics3<T: Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
19 | | field: T,
20 | | }
21 | | }
| | ^
| | |
| | expected one of `+`, `,`, `=`, or `>`
| |_unexpected token
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
help: you might have meant to end the type parameters here
--> src/lib.rs
|
| $(: $generics_bound>)?
| +
error: expected one of `+`, `,`, `=`, or `>`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:23:1
|
23 | / pin_project! {
24 | | struct Generics4<T: ?Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
25 | | field: T,
26 | | }
27 | | }
| | ^
| | |
| | expected one of `+`, `,`, `=`, or `>`
| |_unexpected token
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
help: you might have meant to end the type parameters here
--> src/lib.rs
|
| $(: ?$generics_unsized_bound>)?
| +
error: expected one of `+`, `,`, `=`, or `>`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:23:1
|
23 | / pin_project! {
24 | | struct Generics4<T: ?Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
25 | | field: T,
26 | | }
27 | | }
| | ^
| | |
| |_expected one of `+`, `,`, `=`, or `>`
| unexpected token
|
= note: type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
help: you might have meant to end the type parameters here
--> src/lib.rs
|
| $(: ?$generics_unsized_bound>)?
| +
error: expected one of `+`, `,`, `=`, or `>`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:23:1
|
23 | / pin_project! {
24 | | struct Generics4<T: ?Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
25 | | field: T,
26 | | }
27 | | }
| | ^
| | |
| | expected one of `+`, `,`, `=`, or `>`
| |_unexpected token
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
help: you might have meant to end the type parameters here
--> src/lib.rs
|
| $(: ?$generics_unsized_bound>)?
| +
error: expected one of `+`, `,`, `=`, or `>`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:23:1
|
23 | / pin_project! {
24 | | struct Generics4<T: ?Sized : 'static> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
25 | | field: T,
26 | | }
27 | | }
| | ^
| | |
| | expected one of `+`, `,`, `=`, or `>`
| |_unexpected token
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
help: you might have meant to end the type parameters here
--> src/lib.rs
|
| $(: ?$generics_unsized_bound>)?
| +
error: expected one of `+`, `,`, `=`, or `>`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:29:1
|
29 | / pin_project! {
30 | | struct Generics5<T: Sized : ?Sized> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
31 | | field: T,
32 | | }
33 | | }
| | ^
| | |
| | expected one of `+`, `,`, `=`, or `>`
| |_unexpected token
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
help: you might have meant to end the type parameters here
--> src/lib.rs
|
| $(: $generics_bound>)?
| +
error: expected one of `+`, `,`, `=`, or `>`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:29:1
|
29 | / pin_project! {
30 | | struct Generics5<T: Sized : ?Sized> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
31 | | field: T,
32 | | }
33 | | }
| | ^
| | |
| |_expected one of `+`, `,`, `=`, or `>`
| unexpected token
|
= note: type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
help: you might have meant to end the type parameters here
--> src/lib.rs
|
| $(: $generics_bound>)?
| +
error: expected one of `+`, `,`, `=`, or `>`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:29:1
|
29 | / pin_project! {
30 | | struct Generics5<T: Sized : ?Sized> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
31 | | field: T,
32 | | }
33 | | }
| | ^
| | |
| | expected one of `+`, `,`, `=`, or `>`
| |_unexpected token
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
help: you might have meant to end the type parameters here
--> src/lib.rs
|
| $(: $generics_bound>)?
| +
error: expected one of `+`, `,`, `=`, or `>`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:29:1
|
29 | / pin_project! {
30 | | struct Generics5<T: Sized : ?Sized> { //~ ERROR expected one of `+`, `,`, `=`, or `>`, found `:`
31 | | field: T,
32 | | }
33 | | }
| | ^
| | |
| | expected one of `+`, `,`, `=`, or `>`
| |_unexpected token
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
help: you might have meant to end the type parameters here
--> src/lib.rs
|
| $(: $generics_bound>)?
| +
error: no rules expected `Sized`
--> tests/ui/pin_project/invalid-bounds.rs:36:34
|
36 | struct Generics6<T: ?Sized : Sized> { //~ ERROR no rules expected the token `Sized`
| ^^^^^ no rules expected this token in macro call
|
note: while trying to match meta-variable `$generics_lifetime_bound:lifetime`
--> src/lib.rs
|
| $(: $generics_lifetime_bound:lifetime)?
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: no rules expected `:`
--> tests/ui/pin_project/invalid-bounds.rs:44:20
|
44 | T: 'static : Sized //~ ERROR no rules expected the token `:`
| ^ no rules expected this token in macro call
|
note: while trying to match `{`
--> src/lib.rs
|
| {
| ^
error: no rules expected `:`
--> tests/ui/pin_project/invalid-bounds.rs:53:20
|
53 | T: 'static : ?Sized //~ ERROR no rules expected the token `:`
| ^ no rules expected this token in macro call
|
note: while trying to match `{`
--> src/lib.rs
|
| {
| ^
error: expected `{` after struct name, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:59:1
|
59 | / pin_project! {
60 | | struct WhereClause3<T>
61 | | where
62 | | T: Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
66 | | }
| | ^
| | |
| |_expected `{` after struct name
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected one of `+`, `,`, or `{`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:59:1
|
59 | / pin_project! {
60 | | struct WhereClause3<T>
61 | | where
62 | | T: Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
66 | | }
| | ^
| | |
| |_expected one of `+`, `,`, or `{`
| unexpected token
|
= note: type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `{` after struct name, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:59:1
|
59 | / pin_project! {
60 | | struct WhereClause3<T>
61 | | where
62 | | T: Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
66 | | }
| | ^
| | |
| |_expected `{` after struct name
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `{` after struct name, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:59:1
|
59 | / pin_project! {
60 | | struct WhereClause3<T>
61 | | where
62 | | T: Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
66 | | }
| | ^
| | |
| |_expected `{` after struct name
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `{` after struct name, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:68:1
|
68 | / pin_project! {
69 | | struct WhereClause4<T>
70 | | where
71 | | T: ?Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
75 | | }
| | ^
| | |
| |_expected `{` after struct name
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected one of `+`, `,`, or `{`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:68:1
|
68 | / pin_project! {
69 | | struct WhereClause4<T>
70 | | where
71 | | T: ?Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
75 | | }
| | ^
| | |
| |_expected one of `+`, `,`, or `{`
| unexpected token
|
= note: type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `{` after struct name, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:68:1
|
68 | / pin_project! {
69 | | struct WhereClause4<T>
70 | | where
71 | | T: ?Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
75 | | }
| | ^
| | |
| |_expected `{` after struct name
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `{` after struct name, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:68:1
|
68 | / pin_project! {
69 | | struct WhereClause4<T>
70 | | where
71 | | T: ?Sized : 'static //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
75 | | }
| | ^
| | |
| |_expected `{` after struct name
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `{` after struct name, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:77:1
|
77 | / pin_project! {
78 | | struct WhereClause5<T>
79 | | where
80 | | T: Sized : ?Sized //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
84 | | }
| | ^
| | |
| |_expected `{` after struct name
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected one of `+`, `,`, or `{`, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:77:1
|
77 | / pin_project! {
78 | | struct WhereClause5<T>
79 | | where
80 | | T: Sized : ?Sized //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
84 | | }
| | ^
| | |
| |_expected one of `+`, `,`, or `{`
| unexpected token
|
= note: type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `{` after struct name, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:77:1
|
77 | / pin_project! {
78 | | struct WhereClause5<T>
79 | | where
80 | | T: Sized : ?Sized //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
84 | | }
| | ^
| | |
| |_expected `{` after struct name
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `{` after struct name, found `:`
--> tests/ui/pin_project/invalid-bounds.rs:77:1
|
77 | / pin_project! {
78 | | struct WhereClause5<T>
79 | | where
80 | | T: Sized : ?Sized //~ ERROR expected `where`, or `{` after struct name, found `:`
... |
84 | | }
| | ^
| | |
| |_expected `{` after struct name
| in this macro invocation
|
= note: this error originates in the macro `$crate::__pin_project_parse_generics` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: no rules expected `Sized`
--> tests/ui/pin_project/invalid-bounds.rs:89:21
|
89 | T: ?Sized : Sized //~ ERROR no rules expected the token `Sized`
| ^^^^^ no rules expected this token in macro call
|
note: while trying to match meta-variable `$where_clause_lifetime_bound:lifetime`
--> src/lib.rs
|
| $(: $where_clause_lifetime_bound:lifetime)?
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@@ -0,0 +1,27 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
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,53 @@
error: no rules expected `(`
--> tests/ui/pin_project/invalid.rs:7:14
|
7 | #[pin()] //~ ERROR no rules expected the token `(`
| ^ no rules expected this token in macro call
|
note: while trying to match `]`
--> src/lib.rs
|
| $(#[$pin:ident])?
| ^
error: no rules expected `(`
--> tests/ui/pin_project/invalid.rs:7:14
|
7 | #[pin()] //~ ERROR no rules expected the token `(`
| ^ no rules expected this token in macro call
|
note: while trying to match `]`
--> src/lib.rs
|
| $(#[$pin:ident])?
| ^
error: no rules expected `#`
--> tests/ui/pin_project/invalid.rs:22:9
|
22 | #[pin] //~ ERROR no rules expected the token `#`
| ^ no rules expected this token in macro call
|
note: while trying to match meta-variable `$field_vis:vis`
--> src/lib.rs
|
| $field_vis:vis $field:ident: $field_ty:ty
| ^^^^^^^^^^^^^^
error: no rules expected `#`
--> tests/ui/pin_project/invalid.rs:22:9
|
22 | #[pin] //~ ERROR no rules expected the token `#`
| ^ no rules expected this token in macro call
|
note: while trying to match meta-variable `$field_vis:vis`
--> src/lib.rs
|
| $field_vis:vis $field:ident: $field_ty:ty
| ^^^^^^^^^^^^^^
error: cannot find attribute `pin` in this scope
--> tests/ui/pin_project/invalid.rs:13:7
|
13 | #[pin] //~ ERROR cannot find attribute `pin` in this scope
| ^^^

View File

@@ -0,0 +1,21 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
// https://github.com/taiki-e/pin-project/issues/340#issuecomment-2428002670
pin_project_lite::pin_project! {
struct Foo<Pinned, Unpinned> {
#[pin]
pinned: Pinned,
unpinned: Unpinned,
}
}
struct MyPhantomPinned(::core::marker::PhantomPinned);
impl Unpin for MyPhantomPinned where for<'cursed> str: Sized {}
impl Unpin for Foo<MyPhantomPinned, ()> {}
fn is_unpin<T: Unpin>() {}
fn main() {
is_unpin::<Foo<MyPhantomPinned, ()>>()
}

View File

@@ -0,0 +1,15 @@
error[E0119]: conflicting implementations of trait `Unpin` for type `Foo<MyPhantomPinned, ()>`
--> tests/ui/pin_project/negative_impls_stable.rs:5:1
|
5 | / pin_project_lite::pin_project! {
6 | | struct Foo<Pinned, Unpinned> {
7 | | #[pin]
8 | | pinned: Pinned,
... |
11 | | }
| |_^ conflicting implementation for `Foo<MyPhantomPinned, ()>`
...
15 | impl Unpin for Foo<MyPhantomPinned, ()> {}
| --------------------------------------- first implementation here
|
= note: this error originates in the macro `$crate::__pin_project_make_unpin_impl` which comes from the expansion of the macro `pin_project_lite::pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@@ -0,0 +1,12 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
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[E0403]: the name `'__pin` is already used for a generic parameter in this item's generic parameters
--> tests/ui/pin_project/overlapping_lifetime_names.rs:6:20
|
5 | / pin_project! { //~ ERROR E0263,E0496
6 | | pub struct Foo<'__pin, T> {
| | ^^^^^^ already used
7 | | #[pin]
8 | | field: &'__pin mut T,
9 | | }
10 | | }
| |_- first use of `'__pin`
error[E0403]: the name `'__pin` is already used for a generic parameter in this item's generic parameters
--> tests/ui/pin_project/overlapping_lifetime_names.rs:6:20
|
5 | / pin_project! { //~ ERROR E0263,E0496
6 | | pub struct Foo<'__pin, T> {
| | ^^^^^^ already used
7 | | #[pin]
8 | | field: &'__pin mut T,
9 | | }
10 | | }
| |_- first use of `'__pin`
error[E0496]: lifetime name `'__pin` shadows a lifetime name that is already in scope
--> tests/ui/pin_project/overlapping_lifetime_names.rs:5:1
|
5 | / pin_project! { //~ ERROR E0263,E0496
6 | | pub struct Foo<'__pin, T> {
| | ------ first declared here
7 | | #[pin]
8 | | field: &'__pin mut T,
9 | | }
10 | | }
| |_^ lifetime `'__pin` already in scope
|
= note: this error originates in the macro `$crate::__pin_project_struct_make_proj_method` which comes from the expansion of the macro `pin_project` (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:5:1
|
5 | / pin_project! { //~ ERROR E0263,E0496
6 | | pub struct Foo<'__pin, T> {
| | ------ first declared here
7 | | #[pin]
8 | | field: &'__pin mut T,
9 | | }
10 | | }
| |_^ lifetime `'__pin` already in scope
|
= note: this error originates in the macro `$crate::__pin_project_struct_make_proj_method` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0403]: the name `'__pin` is already used for a generic parameter in this item's generic parameters
--> tests/ui/pin_project/overlapping_lifetime_names.rs:6:20
|
5 | / pin_project! { //~ ERROR E0263,E0496
6 | | pub struct Foo<'__pin, T> {
| | ^^^^^^ already used
7 | | #[pin]
8 | | field: &'__pin mut T,
9 | | }
10 | | }
| |_- first use of `'__pin`
error[E0403]: the name `'__pin` is already used for a generic parameter in this item's generic parameters
--> tests/ui/pin_project/overlapping_lifetime_names.rs:6:20
|
5 | / pin_project! { //~ ERROR E0263,E0496
6 | | pub struct Foo<'__pin, T> {
| | ^^^^^^ already used
7 | | #[pin]
8 | | field: &'__pin mut T,
9 | | }
10 | | }
| |_- first use of `'__pin`

View File

@@ -0,0 +1,22 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
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,34 @@
error[E0277]: `PhantomPinned` cannot be unpinned
--> tests/ui/pin_project/overlapping_unpin_struct.rs:21:16
|
21 | is_unpin::<Foo<PhantomPinned>>(); //~ ERROR E0277
| ^^^^^^^^^^^^^^^^^^ within `_::__Origin<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned`
|
= note: consider using the `pin!` macro
consider using `Box::pin` if you need to access the pinned value outside of the current scope
note: required because it appears within the type `_::__Origin<'_, PhantomPinned>`
--> tests/ui/pin_project/overlapping_unpin_struct.rs:7:1
|
7 | / pin_project! {
8 | | struct Foo<T> {
9 | | #[pin]
10 | | inner: T,
11 | | }
12 | | }
| |_^
note: required for `Foo<PhantomPinned>` to implement `Unpin`
--> tests/ui/pin_project/overlapping_unpin_struct.rs:7:1
|
7 | / pin_project! {
8 | | struct Foo<T> {
9 | | #[pin]
10 | | inner: T,
11 | | }
12 | | }
| |_^ unsatisfied trait bound introduced here
note: required by a bound in `is_unpin`
--> tests/ui/pin_project/overlapping_unpin_struct.rs:18:16
|
18 | 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` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@@ -0,0 +1,21 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
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,95 @@
error[E0793]: 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]
... |
11 | | }
| |_^
|
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
= note: 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_struct_make_proj_method` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0793]: 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]
... |
11 | | }
| |_^
|
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
= note: 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_struct_make_proj_method` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0793]: 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]
... |
11 | | }
| |_^
|
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
= note: 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` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0793]: 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]
... |
19 | | }
| |_^
|
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
= note: 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_struct_make_proj_method` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0793]: 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]
... |
19 | | }
| |_^
|
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
= note: 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_struct_make_proj_method` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0793]: 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]
... |
19 | | }
| |_^
|
= note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
= note: 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` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@@ -0,0 +1,14 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
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,5 @@
error[E0412]: cannot find type `__Origin` in this scope
--> tests/ui/pin_project/unpin_sneaky.rs:12:16
|
12 | impl Unpin for __Origin {} //~ ERROR E0412,E0321
| ^^^^^^^^ not found in this scope

View File

@@ -0,0 +1,29 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
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,111 @@
error: no rules expected `}`
--> tests/ui/pin_project/unsupported.rs:5:1
|
5 | / pin_project! {
6 | | struct Struct1 {} //~ ERROR no rules expected the token `}`
7 | | }
| |_^ no rules expected this token in macro call
|
note: while trying to match meta-variable `$field_vis:vis`
--> src/lib.rs
|
| $field_vis:vis $field:ident: $field_ty:ty
| ^^^^^^^^^^^^^^
= note: this error originates in the macro `$crate::__pin_project_expand` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: no rules expected `}`
--> tests/ui/pin_project/unsupported.rs:5:1
|
5 | / pin_project! {
6 | | struct Struct1 {} //~ ERROR no rules expected the token `}`
7 | | }
| |_^ no rules expected this token in macro call
|
note: while trying to match meta-variable `$field_vis:vis`
--> src/lib.rs
|
| $field_vis:vis $field:ident: $field_ty:ty
| ^^^^^^^^^^^^^^
= note: this error originates in the macro `$crate::__pin_project_expand` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: no rules expected `(`
--> tests/ui/pin_project/unsupported.rs:10:19
|
10 | struct Struct2(); //~ ERROR no rules expected the token `(`
| ^ no rules expected this token in macro call
|
note: while trying to match `{`
--> src/lib.rs
|
| {
| ^
error: no rules expected `;`
--> tests/ui/pin_project/unsupported.rs:14:19
|
14 | struct Struct3; //~ ERROR no rules expected the token `;`
| ^ no rules expected this token in macro call
|
note: while trying to match `{`
--> src/lib.rs
|
| {
| ^
error: no rules expected `(`
--> tests/ui/pin_project/unsupported.rs:19:10
|
19 | A(u8)
| ^ no rules expected this token in macro call
|
note: while trying to match `}`
--> src/lib.rs
|
| }
| ^
error: no rules expected `(`
--> tests/ui/pin_project/unsupported.rs:19:10
|
19 | A(u8)
| ^ no rules expected this token in macro call
|
note: while trying to match `}`
--> src/lib.rs
|
| }
| ^
error: no rules expected identifier `union`
--> tests/ui/pin_project/unsupported.rs:23:1
|
23 | / pin_project! {
24 | | union Union { //~ ERROR no rules expected the token `union`
25 | | x: u8,
26 | | }
27 | | }
| |_^ no rules expected this token in macro call
|
note: while trying to match keyword `struct`
--> src/lib.rs
|
| [$(#[$attrs:meta])* $vis:vis struct $ident:ident]
| ^^^^^^
= note: this error originates in the macro `$crate::__pin_project_expand` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
error: no rules expected identifier `union`
--> tests/ui/pin_project/unsupported.rs:23:1
|
23 | / pin_project! {
24 | | union Union { //~ ERROR no rules expected the token `union`
25 | | x: u8,
26 | | }
27 | | }
| |_^ no rules expected this token in macro call
|
note: while trying to match keyword `struct`
--> src/lib.rs
|
| [$(#[$attrs:meta])* $vis:vis struct $ident:ident]
| ^^^^^^
= note: this error originates in the macro `$crate::__pin_project_expand` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@@ -0,0 +1,19 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
use pin_project_lite::pin_project;
pin_project! {
pub struct S {
#[pin]
field: u8,
}
impl PinnedDrop for S {
fn drop(this: Pin<&mut Self>) {
__drop_inner(this);
}
}
}
fn main() {
let _x = S { field: 0 };
}

View File

@@ -0,0 +1,22 @@
error[E0061]: this function takes 0 arguments but 1 argument was supplied
--> tests/ui/pinned_drop/call-drop-inner.rs:12:13
|
12 | __drop_inner(this);
| ^^^^^^^^^^^^ ---- unexpected argument of type `Pin<&mut S>`
|
note: function defined here
--> tests/ui/pinned_drop/call-drop-inner.rs:5:1
|
5 | / pin_project! {
6 | | pub struct S {
7 | | #[pin]
8 | | field: u8,
... |
15 | | }
| |_^
= note: this error originates in the macro `$crate::__pin_project_make_drop_impl` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)
help: remove the extra argument
|
12 - __drop_inner(this);
12 + __drop_inner();
|

View File

@@ -0,0 +1,28 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
use pin_project_lite::pin_project;
// In `Drop` impl, the implementor must specify the same requirement as type definition.
struct DropImpl<T> {
f: T,
}
impl<T: Unpin> Drop for DropImpl<T> {
//~^ ERROR E0367
fn drop(&mut self) {}
}
pin_project! {
//~^ ERROR E0367
struct PinnedDropImpl<T> {
#[pin]
f: T,
}
impl<T: Unpin> PinnedDrop for PinnedDropImpl<T> {
fn drop(_this: Pin<&mut Self>) {}
}
}
fn main() {}

View File

@@ -0,0 +1,34 @@
error[E0367]: `Drop` impl requires `T: Unpin` but the struct it is implemented for does not
--> tests/ui/pinned_drop/conditional-drop-impl.rs:11:9
|
11 | impl<T: Unpin> Drop for DropImpl<T> {
| ^^^^^
|
note: the implementor must specify the same requirement
--> tests/ui/pinned_drop/conditional-drop-impl.rs:7:1
|
7 | struct DropImpl<T> {
| ^^^^^^^^^^^^^^^^^^
error[E0367]: `Drop` impl requires `T: Unpin` but the struct it is implemented for does not
--> tests/ui/pinned_drop/conditional-drop-impl.rs:16:1
|
16 | / pin_project! {
17 | | //~^ ERROR E0367
18 | | struct PinnedDropImpl<T> {
19 | | #[pin]
... |
26 | | }
| |_^
|
note: the implementor must specify the same requirement
--> tests/ui/pinned_drop/conditional-drop-impl.rs:16:1
|
16 | / pin_project! {
17 | | //~^ ERROR E0367
18 | | struct PinnedDropImpl<T> {
19 | | #[pin]
... |
26 | | }
| |_^
= note: this error originates in the macro `$crate::__pin_project_make_drop_impl` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info)