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

Fix ArrayVec capacity not taking u16::MAX into account #178

Merged
merged 1 commit into from
Feb 22, 2023

Conversation

e00E
Copy link
Contributor

@e00E e00E commented Feb 22, 2023

The capacity is limited by the backing array and u16::MAX because the length is stored as a u16. This was not taken into account in the fn capacity implementation.

@Lokathor
Copy link
Owner

u16::MAX wasn't available until rust 1.43
https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1430-2020-04-23
and currently CI checks against 1.34

This is probably a good time to "implement" #174 and up the CI. I can't even remember what exactly was allowed in what versions that long ago (other than 1.36 being "the one with alloc").

Stable is currently 1.67, so let's go with "Stable-20" and bump the tinyvec CI to use rust 1.47.

Sorry to throw this extra work at you. If you'd like to also fix up the cargo features based on what 1.47 allows that would be nice but you don't have to.

@e00E
Copy link
Contributor Author

e00E commented Feb 22, 2023

What should happen to the rustc_1_40 feature? Delete it?

@e00E
Copy link
Contributor Author

e00E commented Feb 22, 2023

I'd like to keep this PR focused on this change. I'll change the CI to run 1.47 but won't track down other stuff for now.

@e00E
Copy link
Contributor Author

e00E commented Feb 22, 2023

#179

@Lokathor
Copy link
Owner

Sounds good, we can handle that PR first and then come back to this one.

@Lokathor
Copy link
Owner

I think i can get it to run CI again if i just close and reopen the PR...

@Lokathor Lokathor closed this Feb 22, 2023
@Lokathor Lokathor reopened this Feb 22, 2023
The capacity is limited by the backing array and u16::MAX because the
length is stored as a u16. This was not taken into account in the
`fn capacity` implementation.
@e00E
Copy link
Contributor Author

e00E commented Feb 22, 2023

I rebased it to main.

@Lokathor Lokathor merged commit 48c004d into Lokathor:main Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants