-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Rust doesn't use niche in reference (or pointer) to slice #132235
Copy link
Copy link
Open
Labels
A-layoutArea: Memory layout of typesArea: Memory layout of typesC-optimizationCategory: An issue highlighting optimization opportunities or PRs implementing suchCategory: An issue highlighting optimization opportunities or PRs implementing suchE-needs-designThis issue needs exploration and design to see how and if we can fix/implement itThis issue needs exploration and design to see how and if we can fix/implement itT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-layoutArea: Memory layout of typesArea: Memory layout of typesC-optimizationCategory: An issue highlighting optimization opportunities or PRs implementing suchCategory: An issue highlighting optimization opportunities or PRs implementing suchE-needs-designThis issue needs exploration and design to see how and if we can fix/implement itThis issue needs exploration and design to see how and if we can fix/implement itT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
From reddit thread: why can't rust optimize the size of
Option<Option<&str>>?Indeed, in spite of the fact that
&strdoesn't all use more than half of possible bit sequences (top bit of 2nd word is always zero, plus first word can not be zero) onlyOption<&str>is optimizedWould it make sense to teach compiler about that niche or is it prevented by some deeper issue?