diff options
author | Joel Galenson <jgalenson@google.com> | 2021-05-19 16:12:52 -0700 |
---|---|---|
committer | Joel Galenson <jgalenson@google.com> | 2021-05-19 16:12:52 -0700 |
commit | c95dc516440636acb2e9f0b61e3a4595a90c4d2e (patch) | |
tree | a2808291a9d00789d7f23e0e6bc9e133aace307a /examples | |
parent | 1a7271af628c203700f21c3b3eac18bbd7373340 (diff) | |
download | pin-project-c95dc516440636acb2e9f0b61e3a4595a90c4d2e.tar.gz |
Upgrade rust/crates/pin-project to 1.0.7
Test: make
Change-Id: I9cb8c4f9c94d68c5775ee9a360f4e882a836e186
Diffstat (limited to 'examples')
-rw-r--r-- | examples/not_unpin-expanded.rs | 2 | ||||
-rw-r--r-- | examples/pinned_drop-expanded.rs | 3 | ||||
-rw-r--r-- | examples/project_replace-expanded.rs | 2 | ||||
-rw-r--r-- | examples/struct-default-expanded.rs | 8 | ||||
-rw-r--r-- | examples/unsafe_unpin-expanded.rs | 2 |
5 files changed, 8 insertions, 9 deletions
diff --git a/examples/not_unpin-expanded.rs b/examples/not_unpin-expanded.rs index aa5209d..5700c12 100644 --- a/examples/not_unpin-expanded.rs +++ b/examples/not_unpin-expanded.rs @@ -76,7 +76,7 @@ const _: () = { // // See ./struct-default-expanded.rs and https://github.com/taiki-e/pin-project/pull/34 // for details. - #[forbid(safe_packed_borrows)] + #[forbid(unaligned_references, safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &Struct<T, U>) { let _ = &this.pinned; let _ = &this.unpinned; diff --git a/examples/pinned_drop-expanded.rs b/examples/pinned_drop-expanded.rs index 48eb7fc..019f151 100644 --- a/examples/pinned_drop-expanded.rs +++ b/examples/pinned_drop-expanded.rs @@ -82,7 +82,7 @@ const _: () = { // // See ./struct-default-expanded.rs and https://github.com/taiki-e/pin-project/pull/34 // for details. - #[forbid(safe_packed_borrows)] + #[forbid(unaligned_references, safe_packed_borrows)] fn __assert_not_repr_packed<'a, T>(this: &Struct<'a, T>) { let _ = &this.was_dropped; let _ = &this.field; @@ -135,6 +135,7 @@ const _: () = { // Users can implement [`Drop`] safely using `#[pinned_drop]` and can drop a // type that implements `PinnedDrop` using the [`drop`] function safely. // **Do not call or implement this trait directly.** +#[doc(hidden)] impl<T> ::pin_project::__private::PinnedDrop for Struct<'_, T> { // Since calling it twice on the same object would be UB, // this method is unsafe. diff --git a/examples/project_replace-expanded.rs b/examples/project_replace-expanded.rs index 4f43bda..ebb8e00 100644 --- a/examples/project_replace-expanded.rs +++ b/examples/project_replace-expanded.rs @@ -112,7 +112,7 @@ const _: () = { // // See ./struct-default-expanded.rs and https://github.com/taiki-e/pin-project/pull/34 // for details. - #[forbid(safe_packed_borrows)] + #[forbid(unaligned_references, safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &Struct<T, U>) { let _ = &this.pinned; let _ = &this.unpinned; diff --git a/examples/struct-default-expanded.rs b/examples/struct-default-expanded.rs index 3d0e4ab..d661099 100644 --- a/examples/struct-default-expanded.rs +++ b/examples/struct-default-expanded.rs @@ -71,10 +71,8 @@ const _: () = { // Ensure that it's impossible to use pin projections on a #[repr(packed)] // struct. // - // Taking a reference to a packed field is unsafe, and applying - // #[forbid(safe_packed_borrows)] makes sure that doing this without - // an 'unsafe' block (which we deliberately do not generate) - // is a hard error. + // Taking a reference to a packed field is UB, and applying + // `#[forbid(unaligned_references)]` makes sure that doing this is a hard error. // // If the struct ends up having #[repr(packed)] applied somehow, // this will generate an (unfriendly) error message. Under all reasonable @@ -82,7 +80,7 @@ const _: () = { // a much nicer error above. // // See https://github.com/taiki-e/pin-project/pull/34 for more details. - #[forbid(safe_packed_borrows)] + #[forbid(unaligned_references, safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &Struct<T, U>) { let _ = &this.pinned; let _ = &this.unpinned; diff --git a/examples/unsafe_unpin-expanded.rs b/examples/unsafe_unpin-expanded.rs index 2ea1f37..e9c7abc 100644 --- a/examples/unsafe_unpin-expanded.rs +++ b/examples/unsafe_unpin-expanded.rs @@ -75,7 +75,7 @@ const _: () = { // // See ./struct-default-expanded.rs and https://github.com/taiki-e/pin-project/pull/34 // for details. - #[forbid(safe_packed_borrows)] + #[forbid(unaligned_references, safe_packed_borrows)] fn __assert_not_repr_packed<T, U>(this: &Struct<T, U>) { let _ = &this.pinned; let _ = &this.unpinned; |