Skip to content

Commit

Permalink
Revert "Work around ICE in rustc: the naive layout isn't refined by t…
Browse files Browse the repository at this point in the history
…he actual layout"

Fixed in nightly-2023-07-23.

This reverts commit a186f88.
  • Loading branch information
dtolnay committed Jul 23, 2023
1 parent e528e11 commit 2537c60
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,7 @@ document_iter! {
mod void_iter {
enum Void {}

// https://github.com/rust-lang/rust/issues/113941
const WORK_AROUND_RUST_ISSUE_113941: usize = 1;
pub struct Iter<T>([*const T; WORK_AROUND_RUST_ISSUE_113941], Void);
pub struct Iter<T>([*const T; 0], Void);

unsafe impl<T> Send for Iter<T> {}
unsafe impl<T> Sync for Iter<T> {}
Expand Down
5 changes: 2 additions & 3 deletions tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ struct Thing(usize);

#[test]
fn test_iter() {
// https://github.com/rust-lang/rust/issues/113941
assert_eq!(16, mem::size_of::<inventory::iter<Thing>>()); // FIXME
assert_eq!(8, mem::align_of::<inventory::iter<Thing>>()); // FIXME
assert_eq!(0, mem::size_of::<inventory::iter<Thing>>());
assert_eq!(1, mem::align_of::<inventory::iter<Thing>>());
}

0 comments on commit 2537c60

Please sign in to comment.