Landing: 3b972ec2fbdf
Project / Subsystem
gcc / gccrs
Date
2026-06-27
Author
Lucas Ly Ba
Commit
3b972ec2fbdf049c561be3875cfda596cecc74dc
Source
github
Perf win
No
Breaking
No
All attributes
- project
- gcc
- subsystem
- gccrs
- patch_id
- —
- commit_hash
- 3b972ec2fbdf049c561be3875cfda596cecc74dc
- source_type
- github
- headline
- GCC Rust frontend adds lint for mutable static references
- tldr
- GCC's Rust frontend now warns about taking references to mutable statics to prevent undefined behavior.
- author
- Lucas Ly Ba
- outcome
- committed
- performance_win
- false
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • gccrs
- • rust
- • lint
- • safety
- • undefined behavior
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-06-27T00:00:00.000Z
A new lint has been added to GCC’s Rust frontend to warn against taking references to mutable static variables. This practice can easily lead to undefined behavior, and the new lint aims to improve code safety by discouraging it.