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

Encountered Compilation Error with ?Sized #9

Closed
lithbitren opened this issue Jul 23, 2024 · 1 comment
Closed

Encountered Compilation Error with ?Sized #9

lithbitren opened this issue Jul 23, 2024 · 1 comment

Comments

@lithbitren
Copy link

[dependencies]
sharded = "0.2.1"

My environment is rust 1.81.0-nightly, and I've tested this issue on both Windows 10 and Ubuntu 24.04. Including the latest sharded library version results in a compilation error. Following the compiler's suggestion to remove ?Sized + allows the program to run smoothly.

The specific error points to a line in the sharded library's source code, which can be found at:

K: ?Sized + Eq,

The error details indicate:

   |
15 | fn equivalent_key<K, V>(k: &K) -> impl Fn(&(K, V)) -> bool + '_
   |                   - this type parameter needs to be `Sized`
...
19 |     move |x| k.eq(x.0.borrow())
   |           ^ doesn't have a size known at compile-time
   |
   = note: only the last element of a tuple may have a dynamically sized type
help: consider removing the `?Sized` bound to make the type parameter `Sized`
   |
17 -     K: ?Sized + Eq,
17 +     K: Eq,
   |

For more information about this error, try `rustc --explain E0277`.
@nkconnor
Copy link
Owner

Fixed in #8

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

2 participants