Skip to content

Comprehensive niche checks for Rust #262

@nikomatsakis

Description

@nikomatsakis
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


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

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Project goal

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions