aboutsummaryrefslogtreecommitdiff
path: root/examples/struct-default-expanded.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/struct-default-expanded.rs')
-rw-r--r--examples/struct-default-expanded.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/struct-default-expanded.rs b/examples/struct-default-expanded.rs
index d661099..3d0e4ab 100644
--- a/examples/struct-default-expanded.rs
+++ b/examples/struct-default-expanded.rs
@@ -71,8 +71,10 @@ const _: () = {
// Ensure that it's impossible to use pin projections on a #[repr(packed)]
// struct.
//
- // Taking a reference to a packed field is UB, and applying
- // `#[forbid(unaligned_references)]` makes sure that doing this is a hard error.
+ // 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.
//
// If the struct ends up having #[repr(packed)] applied somehow,
// this will generate an (unfriendly) error message. Under all reasonable
@@ -80,7 +82,7 @@ const _: () = {
// a much nicer error above.
//
// See https://github.com/taiki-e/pin-project/pull/34 for more details.
- #[forbid(unaligned_references, safe_packed_borrows)]
+ #[forbid(safe_packed_borrows)]
fn __assert_not_repr_packed<T, U>(this: &Struct<T, U>) {
let _ = &this.pinned;
let _ = &this.unpinned;