-
Notifications
You must be signed in to change notification settings - Fork 74
Open
Description
Metadata | |
---|---|
Point of contact | @1c3t3a |
Team(s) | compiler, opsem |
Goal document | 2025h2/comprehensive-niche-checks |
Summary
Add runtime checks to rustc that check for valid niche values. This is an
extension of a previous project goal
that added null pointer and enum checks and generally works towards checking for
Undefined behavior at runtime (in debug builds / behind compiler flags).
The check should fire for invalid values that are already created by inserting
a check at load-time / on function entry.
Tasks and status
- To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
Note: we have updated the body to match the 2025h2 goal. Your original text is preserved below.
Metadata | |
---|---|
Point of contact | @1c3t3a |
Team(s) | compiler, lang, opsem |
Goal document | 2025h1/null-enum-discriminant-debug-checks |
Summary
Add runtime checks to rustc that check for null pointers on pointer access and
invalid enum discriminants. Similar to integer overflow and pointer alignment
checks, this will only be enabled in debug builds.
Tasks and status
- To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
Metadata
Metadata
Assignees
Type
Projects
Status
Project goal
Milestone
Relationships
Development
Select code repository
Activity
nikomatsakis commentedon Feb 18, 2025
This issue is intended for status updates only.
For general questions or comments, please contact the owner(s) directly.
1c3t3a commentedon Feb 19, 2025
Status update: The null-checks landed in rust#134424. Next up are the enum discriminant checks.
1c3t3a commentedon May 22, 2025
Upps, giving another status update here:
Key developments: Landed an extension of the alignment check to include (mutable) borrows in rust#137940. Working on the enums check (no draft PR yet). Hope to open a PR by mid next week.
Blockers: None so far.
Help wanted: Happy to join forces on general checks and for advice what other UB would be great to check!! :)
1c3t3a commentedon Jul 25, 2025
Key developments: Landed the enum discriminant check and enabled it for transmutes to enums for now (this is not so powerful), currently extending it to union reads and pointer reads.
Blockers: question of how to insert a check if we already observe UB (e.g. the enum is only represented by an i1 in LLVM IR). This is to be addressed by the next project goal: https://rust-lang.github.io/rust-project-goals/2025h2/comprehensive-niche-checks.html.
[-]Null and enum-discriminant runtime checks in debug builds[/-][+]Comprehensive niche checks for Rust[/+]nikomatsakis commentedon Sep 16, 2025
This is a continuing project goal, and the updates below this comment will be for the new period 2025h2
nikomatsakis commentedon Sep 16, 2025
This is a continuing project goal, and the updates below this comment will be for the new period 2025h2
nikomatsakis commentedon Sep 16, 2025
This is a continuing project goal, and the updates below this comment will be for the new period 2025h2
nikomatsakis commentedon Sep 16, 2025
This is a continuing project goal, and the updates below this comment will be for the new period 2025h2
nikomatsakis commentedon Sep 16, 2025
This is a continuing project goal, and the updates below this comment will be for the new period 2025h2
nikomatsakis commentedon Sep 16, 2025
This is a continuing project goal, and the updates below this comment will be for the new period 2025h2
nikomatsakis commentedon Sep 16, 2025
This is a continuing project goal, and the updates below this comment will be for the new period 2025h2
nikomatsakis commentedon Sep 16, 2025
This is a continuing project goal, and the updates below this comment will be for the new period 2025h2