-
Notifications
You must be signed in to change notification settings - Fork 210
LenType
causes regression regarding supported Vec
sizes and usage in libraries.
#568
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
Comments
While the I think this could warrant yanking the 0.9 release. |
This is a breaking change, 0.9.0 should be yanked. See rust-embedded#568
And actually I thought the next release would have been 0.8.1, not a breaking release. In my PR I made efforts to make sure that there were no breaking changes, and documented the breaking changes that were pending, but they were not implemented once it was decided to go with a 0.9.0 instead of 0.8.1 release: #494 I saw the PR for the 0.9 release I should have remembered this sorry. |
This is a breaking change, 0.9.0 should be yanked. See rust-embedded#568
This is a fairly serious issue that is going to break a lot of code. I have yanked 0.9.0 from crates.io for now to save people the effort of attempting to update their code. |
There is an unexpected regression in 0.9.0 with generics that is going to break a lot of code. rust-embedded#568
This is a breaking change, 0.9.0 should be yanked. See rust-embedded#568
I wouldn't really call this a regression since
We can add more sizes, e.g. all up to 1024 to avoid needing the explicit type in most common cases.
Is that a bad thing? A library author should know whether
Not that much harder: let vec: &mut VecView<_, _> = &mut Vec::<u8, 8>::new(); Note this isn't an argument for or against anything, just a clarification that it isn't as dramatically broken as this issue suggests. |
I don't think it's "broken". But it will cause a lot of code churn, for a feature I don't think many users need. At least we don't, we much more concerned about compile times, binary size, and reducing the use of generics in our application code than the small memory overhead this might save (when it even saves anything given the alignment requirements of I suggested yanking because I don't think it was understood that the disruption would be this great. |
This is a breaking change, 0.9.0 should be yanked. See rust-embedded#568
This is a breaking change, 0.9.0 should be yanked. See rust-embedded#568
There is a way to auto implement this kind of len for any capacity using unstable Unfortunately I cannot make compiler to believe that implementation exists for all possible If we cannot figure out how to make len auto-size on all possible inputs, I thin kit should default to Personally I'm very interested to have auto-size len though. I have highly memory constrained workload, some of my dependencies use |
This is a breaking change, 0.9.0 should be yanked. See rust-embedded#568
Closed by #569 |
Uh oh!
There was an error while loading. Please reload this page.
The addition of
LenType
to vecs and theDefaultLenType
means that arbitrary length ofVec
are much less usable.Not all lengths "just work" with
Vec
like they did previouslyFor example, the following:
Vec<u8, 587>
does not compile anymore, and needs to be worked around withVec<u8, u16, 587>
.This itself is I think a significant downgrade in readability (the benefits of
LenType
are in most cases I think not worth making code less readable, since the overhead of the Vec itself will often be negligible compared to the buffer of the Vec).In a library setting it forces the library writer to be explicit of the
LenType
:Fails to compile with
It makes compatibility with
View
types much harder.Because of the
LenType
the following fails to compile:It can be worked around by specifying the
LenType
, but this will mean that theVecView
will not coerce from mostVecs
since most will not useusize
as theLenType
.The text was updated successfully, but these errors were encountered: