Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Break up __pin_project_internal #71

Merged
merged 3 commits into from
Apr 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
535 changes: 268 additions & 267 deletions src/lib.rs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/ui/pin_project/conflict-drop.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ error[E0119]: conflicting implementations of trait `_::MustNotImplDrop` for type
| |_first implementation here
| conflicting implementation for `Foo<_, _>`
|
= note: this error originates in the macro `$crate::__pin_project_internal` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::__pin_project_make_drop_impl` (in Nightly builds, run with -Z macro-backtrace for more info)
6 changes: 3 additions & 3 deletions tests/ui/pin_project/conflict-unpin.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type
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_internal` (in Nightly builds, run with -Z macro-backtrace for more info)
= 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
Expand All @@ -30,7 +30,7 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type
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_internal` (in Nightly builds, run with -Z macro-backtrace for more info)
= 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
Expand All @@ -47,4 +47,4 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type
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_internal` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::__pin_project_make_unpin_impl` (in Nightly builds, run with -Z macro-backtrace for more info)
138 changes: 48 additions & 90 deletions tests/ui/pin_project/invalid-bounds.stderr

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions tests/ui/pin_project/invalid.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ error: no rules expected the token `struct`
8 | | }
| |_^ no rules expected this token in macro call
|
= note: this error originates in the macro `$crate::__pin_project_internal` (in Nightly builds, run with -Z macro-backtrace for more info)
= 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
Expand All @@ -22,7 +22,7 @@ error: no rules expected the token `struct`
8 | | }
| |_^ no rules expected this token in macro call
|
= note: this error originates in the macro `$crate::__pin_project_internal` (in Nightly builds, run with -Z macro-backtrace for more info)
= 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
Expand All @@ -36,7 +36,7 @@ error: no rules expected the token `struct`
23 | | }
| |_^ no rules expected this token in macro call
|
= note: this error originates in the macro `$crate::__pin_project_internal` (in Nightly builds, run with -Z macro-backtrace for more info)
= 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
Expand All @@ -50,7 +50,7 @@ error: no rules expected the token `struct`
23 | | }
| |_^ no rules expected this token in macro call
|
= note: this error originates in the macro `$crate::__pin_project_internal` (in Nightly builds, run with -Z macro-backtrace for more info)
= 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
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/pin_project/overlapping_lifetime_names.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ error[E0496]: lifetime name `'__pin` shadows a lifetime name that is already in
8 | | }
| |_^ lifetime `'__pin` already in scope
|
= note: this error originates in the macro `$crate::__pin_project_internal` (in Nightly builds, run with -Z macro-backtrace for more info)
= 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
Expand All @@ -60,7 +60,7 @@ error[E0496]: lifetime name `'__pin` shadows a lifetime name that is already in
8 | | }
| |_^ lifetime `'__pin` already in scope
|
= note: this error originates in the macro `$crate::__pin_project_internal` (in Nightly builds, run with -Z macro-backtrace for more info)
= 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
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/pin_project/overlapping_unpin_struct.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ note: required by a bound in `is_unpin`
|
16 | fn is_unpin<T: Unpin>() {}
| ^^^^^ required by this bound in `is_unpin`
= note: this error originates in the macro `$crate::__pin_project_internal` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::__pin_project_make_unpin_impl` (in Nightly builds, run with -Z macro-backtrace for more info)
4 changes: 2 additions & 2 deletions tests/ui/pin_project/packed.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ note: the lint level is defined here
= 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_internal` (in Nightly builds, run with -Z macro-backtrace for more info)
= 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
Expand Down Expand Up @@ -54,4 +54,4 @@ note: the lint level is defined here
= 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_internal` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::__pin_project_constant` (in Nightly builds, run with -Z macro-backtrace for more info)
36 changes: 14 additions & 22 deletions tests/ui/pin_project/unsupported.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ 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_internal` (in Nightly builds, run with -Z macro-backtrace for more info)
= 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
Expand All @@ -16,27 +16,19 @@ 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_internal` (in Nightly builds, run with -Z macro-backtrace for more info)
= 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:7:1
error: no rules expected the token `(`
--> tests/ui/pin_project/unsupported.rs:8:19
|
7 | / pin_project! {
8 | | struct Struct2(); //~ ERROR no rules expected the token `(`
9 | | }
| |_^ no rules expected this token in macro call
|
= note: this error originates in the macro `$crate::__pin_project_internal` (in Nightly builds, run with -Z macro-backtrace for more info)
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:11:1
|
11 | / pin_project! {
12 | | struct Struct3; //~ ERROR no rules expected the token `;`
13 | | }
| |_^ no rules expected this token in macro call
error: no rules expected the token `;`
--> tests/ui/pin_project/unsupported.rs:12:19
|
= note: this error originates in the macro `$crate::__pin_project_internal` (in Nightly builds, run with -Z macro-backtrace for more info)
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
Expand All @@ -48,7 +40,7 @@ error: no rules expected the token `enum`
19 | | }
| |_^ no rules expected this token in macro call
|
= note: this error originates in the macro `$crate::__pin_project_internal` (in Nightly builds, run with -Z macro-backtrace for more info)
= 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
Expand All @@ -60,7 +52,7 @@ error: no rules expected the token `enum`
19 | | }
| |_^ no rules expected this token in macro call
|
= note: this error originates in the macro `$crate::__pin_project_internal` (in Nightly builds, run with -Z macro-backtrace for more info)
= 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
Expand All @@ -72,7 +64,7 @@ error: no rules expected the token `union`
25 | | }
| |_^ no rules expected this token in macro call
|
= note: this error originates in the macro `$crate::__pin_project_internal` (in Nightly builds, run with -Z macro-backtrace for more info)
= 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
Expand All @@ -84,4 +76,4 @@ error: no rules expected the token `union`
25 | | }
| |_^ no rules expected this token in macro call
|
= note: this error originates in the macro `$crate::__pin_project_internal` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::__pin_project_expand` (in Nightly builds, run with -Z macro-backtrace for more info)
2 changes: 1 addition & 1 deletion tests/ui/pinned_drop/call-drop-inner.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ note: function defined here
12 | | }
13 | | }
| |_^
= note: this error originates in the macro `$crate::__pin_project_internal` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::__pin_project_make_drop_impl` (in Nightly builds, run with -Z macro-backtrace for more info)
help: remove the extra argument
|
10 | __drop_inner();
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/pinned_drop/conditional-drop-impl.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ note: the implementor must specify the same requirement
23 | | }
24 | | }
| |_^
= note: this error originates in the macro `$crate::__pin_project_internal` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `$crate::__pin_project_make_drop_impl` (in Nightly builds, run with -Z macro-backtrace for more info)