-
Notifications
You must be signed in to change notification settings - Fork 109
Open
Labels
area/dxImprovements or additions to DX or docsImprovements or additions to DX or docsarea/libsRelates to first-party libraries/crates/packages (area)Relates to first-party libraries/crates/packages (area)area/libs > error-stackAffects the `error-stack` crate (library)Affects the `error-stack` crate (library)category/enhancementNew feature or requestNew feature or requestlang/rustPull requests that update Rust codePull requests that update Rust codepriority/3 lowLower priority: nice-to-haveLower priority: nice-to-have
Description
Related Problem
Box<Vec<Frame>> is double indirection, but is being used here to minimize the inline size so the box_collection clippy lint is being silenced.
Source:
hash/libs/error-stack/src/report.rs
Line 251 in 958822e
| pub(super) frames: Box<Vec<Frame>>, |
Proposed Solution
The ThinVec crate can be used to remove the double indirection while keeping the single inline pointer size by storing the capacity and length at the start of the allocation.
This crate is trusted by rustc, so shouldn't have any issues with trusting a new dependency.
Alternatives
Keep as-is which will continue the double indirection, although on the cold path.
Additional context
No response
Metadata
Metadata
Assignees
Labels
area/dxImprovements or additions to DX or docsImprovements or additions to DX or docsarea/libsRelates to first-party libraries/crates/packages (area)Relates to first-party libraries/crates/packages (area)area/libs > error-stackAffects the `error-stack` crate (library)Affects the `error-stack` crate (library)category/enhancementNew feature or requestNew feature or requestlang/rustPull requests that update Rust codePull requests that update Rust codepriority/3 lowLower priority: nice-to-haveLower priority: nice-to-have