diff options
Diffstat (limited to 'examples/struct-default-expanded.rs')
-rw-r--r-- | examples/struct-default-expanded.rs | 8 |
1 files changed, 3 insertions, 5 deletions
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; |