-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Description
size_of
is maybe the top use case for function evaluation in static asserts, which doesn't seem like it will happen any time soon. We can satisfy this use case with a very simple and self-contained feature, e.g.
#[assert_size(48)]
struct StringCacheEntry {
next_in_bucket: *mut StringCacheEntry,
hash: u64,
ref_count: AtomicInt,
string: String,
}
I think making this kind of assertion painless will help programs avoid performance regressions.
Metadata
Metadata
Assignees
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.