Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Aug 10, 2019
1 parent db3031c commit 8f6d7fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion pin-project-internal/src/pin_projectable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ fn handle_type(args: TokenStream, item: Item, pinned_drop: Option<ItemFn>) -> Re
Item::Struct(item) => {
let packed_check = ensure_not_packed(&item)?;
let mut res = structs::parse(args, item, pinned_drop)?;
//println!("Packed check: {}", packed_check);
res.extend(packed_check);
Ok(res)
}
Expand Down
6 changes: 3 additions & 3 deletions tests/repr_packed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use std::cell::Cell;
fn weird_repr_packed() {
// We keep track of the field address during
// drop using a thread local, to avoid changing
// the layout of our #[repr(packed)] type
// the layout of our #[repr(packed)] type.
thread_local! {
static FIELD_ADDR: Cell<usize> = Cell::new(0);
}
Expand All @@ -39,8 +39,8 @@ fn weird_repr_packed() {
// We let this field drop by going out of scope,
// rather than explicitly calling drop(foo).
// Calling drop(foo) causes 'foo' to be moved
// into the 'drop' function, resulinting a different
// address
// into the 'drop' function, resulting in a different
// address.
let foo = Foo { field: 27 };
let field_addr = &foo.field as *const u8 as usize;
field_addr
Expand Down

0 comments on commit 8f6d7fd

Please sign in to comment.