Skip to content

§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

Closed

Description

@ehartford

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

  1. added
    documentation
    on Nov 2, 2026
  2. ehartford commented on Nov 2, 2026

    @ehartford
    ContributorAuthor

    Done in spec v7.35 (#2970): §4.2.6 now says as is written where two meanings remain, never because representation is lost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationhuman attn neededspec

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions