Skip to content

Warning in docs of num_traits::cast::AsPrimitive seems to be out-of-date #174

@jesperdj

Description

@jesperdj

The documentation of num_traits::cast::AsPrimitive warns about undefined behavior:

Currently, some uses of the as operator are not entirely safe. In particular, it is undefined behavior if:
...
Or a floating point value does not fit in another floating point type (#15536)

However, issue 15536 is closed and fixed, as far as I understand, and this is not undefined behavior anymore (in fact, it was never really undefined behavior; the LLVM docs described it as such, but those docs have been clarified).

It looks like the warning in the documentation of AsPrimitive is not accurate anymore.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions