-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
46: Add impl block support to #[project] attribute r=taiki-e a=taiki-e This adds a feature to convert an annotated impl to a projected type's impl. Example: ```rust #[project] impl<T, U> Foo<T, U> { fn baz(self) { let Self { future, field } = self; } } // convert to: impl<'_pin, T, U> __FooProjection<'_pin, T, U> { fn baz(self) { let Self { future, field } = self; } } ``` Closes #43 cc @Nemo157 48: Assert lack of Drop impl without implementing Drop r=taiki-e a=Aaron1011 Previously, we would provide an empty Drop impl for types that did not provide a pinned_drop method, in order to assert that the user was not providing their own Drop impl. However, the compiler places certain restrictions on types that implement Drop. For example, you cannot move out of the fields of such types, as that would cause the Drop impl to observe the fields in an uninitialized state. This commit changes to a purely trait-based approach, as used in the assert-impl crate by @upsuper . This prevents the creation of unnecessary Drop impls, while still ensuring that the user cannot provide their own Drop impl without going through pinned_drop Co-authored-by: Taiki Endo <te316e89@gmail.com> Co-authored-by: Aaron Hill <aa1ronham@gmail.com>
- Loading branch information
Showing
8 changed files
with
275 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.