refactor(allocator/vec): limit scope of #[expect(clippy::cast_possible_truncation)]#11074
Merged
graphite-app[bot] merged 1 commit intomainfrom May 17, 2025
Conversation
This was referenced May 16, 2025
Member
Author
CodSpeed Instrumentation Performance ReportMerging #11074 will create unknown performance changesComparing Summary
Benchmarks breakdown
|
a9da8fd to
5ec2e61
Compare
cab4f00 to
51b5b12
Compare
5ec2e61 to
290ae50
Compare
This was referenced May 16, 2025
Dunqing
approved these changes
May 16, 2025
Member
Dunqing
left a comment
There was a problem hiding this comment.
I forgot that attributes can be attached to statements.
This was referenced May 16, 2025
Member
Author
Merge activity
|
…le_truncation)]` (#11074) Follow-on after #10884. Pure refactor. Move the `#[expect(clippy::cast_possible_truncation)]` attributes so they only apply to a single statement, rather than the whole function. That way we can see clearly where there's a dangerous conversion happening. Annoyingly Rust doesn't allow putting attributes on expressions, so this requires statements that can then be attributed-up. But in my view, it's worth it.
51b5b12 to
7e69c08
Compare
290ae50 to
2f05c54
Compare
Base automatically changed from
05-16-perf_allocator_vec_remove_alloc_guard_from_rawvec_from_raw_parts_in_clarify_safety_docs
to
main
May 17, 2025 10:24
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.

Follow-on after #10884.
Pure refactor. Move the
#[expect(clippy::cast_possible_truncation)]attributes so they only apply to a single statement, rather than the whole function. That way we can see clearly where there's a dangerous conversion happening.Annoyingly Rust doesn't allow putting attributes on expressions, so this requires statements that can then be attributed-up. But in my view, it's worth it.