You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
§4.2.6's rationale no longer describes its rule after D181/D182: as is required where two meanings remain, not where bits are lost #2964
Errata #2955 item 8. §4.2.6 still says: "This catches a class of silent data corruption bugs inherited from C. The as keyword signals that the programmer understands the conversion may lose data." After D181 an integer into a float, and after D182 an f64 into an f32, lose bits and are implicit, while i64 into i32 is not; the stated reason no longer predicts the rule. D181's record gives the reason that does: as is spelled where two meanings remain (truncate or round; wrap or trap; sign change), never because representation is lost. Eric blesses the words (D16/D20); docs-only.
Activity
ehartford commentedon Nov 2, 2026
Done in spec v7.35 (#2970): §4.2.6 now says
asis written where two meanings remain, never because representation is lost.