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

Documentation incorrect regarding BoundedSequence.is_empty() #411

Closed
imdex-matthew opened this issue Jul 22, 2024 · 1 comment
Closed

Documentation incorrect regarding BoundedSequence.is_empty() #411

imdex-matthew opened this issue Jul 22, 2024 · 1 comment

Comments

@imdex-matthew
Copy link

Documentation incorrectly indicates that you can check a BoundedSequence is empty.

/// // The default bounded sequence is empty
/// assert!(BoundedSequence::<i32, 5>::default().is_empty());

This results in the following error:

thread '...' panicked at library/core/src/panicking.rs:220:5:
unsafe precondition(s) violated: slice::from_raw_parts requires the pointer to be aligned and non-null, and the total size of the slice not to exceed isize::MAX

@maspe36
Copy link
Collaborator

maspe36 commented Sep 29, 2024

Hey @imdex-matthew, I took a loot at this, and it actually wasn't incorrect documentation. This was a bug in our implementation.

Now that #416 is merged, this should be fixed

@maspe36 maspe36 closed this as completed Sep 29, 2024
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