Fixes Miri error, Optimizes retain implementation, Adds benchmarks#78
Open
fereidani wants to merge 3 commits intomozilla:mainfrom
Open
Fixes Miri error, Optimizes retain implementation, Adds benchmarks#78fereidani wants to merge 3 commits intomozilla:mainfrom
fereidani wants to merge 3 commits intomozilla:mainfrom
Conversation
Collaborator
|
Can you post benchmark results of before and after? Skeptic about the early "return for optimization" and some similar changes which feel drive-by? |
emilio
pushed a commit
that referenced
this pull request
Apr 8, 2026
Error in question:
---- src/lib.rs - ThinVec<T>::extract_if (line 1636) stdout ----
Test executable failed (exit status: 1).
stderr:
error: Undefined Behavior: trying to retag from <1422> for Unique permission at alloc211[0x10], but that tag does not exist in the borrow stack for this location
--> src/lib.rs:2999:25
|
2999 | let v = slice::from_raw_parts_mut(self.vec.as_mut_ptr(), self.old_len);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this error occurs as part of retag at alloc211[0x10..0x40]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
help: <1422> would have been created here, but this is a zero-size retag ([0x10..0x10]) so the tag in question does not exist anywhere
--> src/lib.rs:2999:51
|
2999 | let v = slice::from_raw_parts_mut(self.vec.as_mut_ptr(), self.old_len);
| ^^^^^^^^^^^^^^^^^^^^^
Cherry-picked from #78
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.