Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sharded-slab v0.1.5 tests fail to compile on 32-bit x86 #82

Closed
decathorpe opened this issue Aug 28, 2023 · 5 comments
Closed

sharded-slab v0.1.5 tests fail to compile on 32-bit x86 #82

decathorpe opened this issue Aug 28, 2023 · 5 comments

Comments

@decathorpe
Copy link

I'm maintaining the packages for this crate for Fedora Linux, and it appears that the update to v0.1.5 introduces issues that prevent its tests from compiling on 32-bit x86 (i.e. i686-unknown-linux-gnu), in what looks like compile-time evaluation issue:

error[E0080]: evaluation of `<page::slot::Generation<tests::custom_config::CustomConfig> as Pack<tests::custom_config::CustomConfig>>::LEN` failed
  --> src/page/slot.rs:59:24
   |
59 |     const LEN: usize = (cfg::WIDTH - C::RESERVED_BITS) - Self::SHIFT;
   |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `8_usize - 30_usize`, which would overflow
note: erroneous constant used
    --> src/lib.rs:1030:27
     |
1030 |         let shift = 1 << (Self::LEN - 1);
     |                           ^^^^^^^^^
note: erroneous constant used
    --> src/lib.rs:1043:25
     |
1043 |     const MASK: usize = Self::BITS << Self::SHIFT;
     |                         ^^^^^^^^^^
note: the above error was encountered while instantiating `fn Slab::<u64, tests::custom_config::CustomConfig>::insert::{closure#0}`
 --> /builddir/build/BUILD/rustc-1.72.0-src/library/core/src/ops/function.rs:305:13
note: erroneous constant used
   --> src/page/slot.rs:688:60
    |
688 |     const LEN: usize = cfg::WIDTH - (Lifecycle::<C>::LEN + Generation::<C>::LEN);
    |                                                            ^^^^^^^^^^^^^^^^^^^^
note: erroneous constant used
    --> src/lib.rs:1038:46
     |
1038 |     const SHIFT: usize = Self::Prev::SHIFT + Self::Prev::LEN;
     |                                              ^^^^^^^^^^^^^^^
note: erroneous constant used
    --> src/lib.rs:1043:39
     |
1043 |     const MASK: usize = Self::BITS << Self::SHIFT;
     |                                       ^^^^^^^^^^^
note: erroneous constant used
   --> src/page/slot.rs:760:24
    |
760 |     const LEN: usize = Generation::<C>::LEN;
    |                        ^^^^^^^^^^^^^^^^^^^^
note: erroneous constant used
  --> src/cfg.rs:43:30
   |
43 |     const USED_BITS: usize = Generation::<Self>::LEN + Generation::<Self>::SHIFT;
   |                              ^^^^^^^^^^^^^^^^^^^^^^^
note: erroneous constant used
   --> src/page/slot.rs:705:35
    |
705 |     pub(crate) const MAX: usize = Self::BITS - 1;
    |                                   ^^^^^^^^^^
note: erroneous constant used
  --> src/cfg.rs:90:13
   |
90 |             RefCount::<Self>::MAX,
   |             ^^^^^^^^^^^^^^^^^^^^^
note: erroneous constant used
   --> src/cfg.rs:160:34
    |
160 |             .field("used_bits", &C::USED_BITS)
    |                                  ^^^^^^^^^^^^
note: erroneous constant used
   --> src/cfg.rs:163:50
    |
163 |             .field("max_concurrent_references", &RefCount::<C>::MAX)
    |                                                  ^^^^^^^^^^^^^^^^^^
note: erroneous constant used
   --> src/page/slot.rs:710:61
    |
710 |             test_println!("-> get: {}; MAX={}", self.value, RefCount::<C>::MAX);
    |                                                             ^^^^^^^^^^^^^^^^^^
For more information about this error, try `rustc --explain E0080`.
error: could not compile `sharded-slab` (lib test) due to previous error

@hawkw
Copy link
Owner

hawkw commented Aug 28, 2023

thanks for the report, i'll look into this!

@hawkw
Copy link
Owner

hawkw commented Aug 28, 2023

I've yanked v0.1.5 from crates.io to avoid breaking anyone else's 32-bit builds. We'll release a new version once this is fixed.

@decathorpe
Copy link
Author

Thank you for looking into it!

@loyd
Copy link
Contributor

loyd commented Sep 27, 2023

Exactly the version I needed =)

@hawkw
Copy link
Owner

hawkw commented Sep 27, 2023

@loyd sorry, I'm working on getting a fix for this so we can release a v0.1.6 that will contain your changes and compile for 32-bit platforms! :)

hawkw added a commit that referenced this issue Sep 27, 2023
This would have caught the build failure for 32-bit platforms reported
in issue #82. Adding a 32-bit build job to CI will help ensure we don't
break 32-bit builds in the future.
hawkw added a commit that referenced this issue Sep 27, 2023
This way, the custom-config tests from PR #80 can still be run on 32-bit
targets.

Fixes #82
hawkw added a commit that referenced this issue Sep 27, 2023
This would have caught the build failure for 32-bit platforms reported
in issue #82. Adding a 32-bit build job to CI will help ensure we don't
break 32-bit builds in the future.
hawkw added a commit that referenced this issue Sep 27, 2023
This way, the custom-config tests from PR #80 can still be run on 32-bit
targets.

Fixes #82
hawkw added a commit that referenced this issue Sep 27, 2023
This would have caught the build failure for 32-bit platforms reported
in issue #82. Adding a 32-bit build job to CI will help ensure we don't
break 32-bit builds in the future.
hawkw added a commit that referenced this issue Sep 27, 2023
This way, the custom-config tests from PR #80 can still be run on 32-bit
targets.

Fixes #82
hawkw added a commit that referenced this issue Sep 27, 2023
This would have caught the build failure for 32-bit platforms reported
in issue #82. Adding a 32-bit build job to CI will help ensure we don't
break 32-bit builds in the future.
@hawkw hawkw closed this as completed in 828ffff Sep 27, 2023
hawkw added a commit that referenced this issue Sep 27, 2023
This way, the custom-config tests from PR #80 can still be run on 32-bit
targets.

Fixes #82
hawkw added a commit that referenced this issue Sep 27, 2023
This way, the custom-config tests from PR #80 can still be run on 32-bit
targets.

Fixes #82
hawkw added a commit that referenced this issue Sep 27, 2023
#### Features

*   publicly export `UniqueIter` (#87)
    ([e4d6482](e4d6482),
    closes [#77](#77))

#### Bug Fixes

*   use a smaller `CustomConfig` for 32-bit tests (#84)
    ([828ffff](828ffff),
    closes [#82](#82))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants