Skip to content

items/union example triggers float literal compatibility lint #563

Description

@kyrias

The unions section has an example matching on a float literal, which triggers the rust-lang/rust#41620 compatibility lint:

#[repr(u32)]enumTag{I,F}#[repr(C)]unionU{i:i32,f:f32,}#[repr(C)]structValue{tag:Tag,u:U,}fnis_zero(v:Value) -> bool{unsafe{match v {Value{tag:I,u:U{i:0}} => true,Value{tag:F,u:U{f:0.0}} => true,
_ => false,}}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugIncorrect statements, terminology, or rendering issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions