Skip to content

const_eval interprets comparison-result as integer #25307

Closed
@oli-obk

Description

@oli-obk

TEST2 is a constant int with the value 1

    const X: i32 = 3;
    const TEST3: bool = X < 5;
    const TEST2: bool = TEST3;

TEST5 is also a constant int with the value 1

    const Y: f64 = 3.14;
    const TEST4: bool = Y < 5.1;
    const TEST5: bool = TEST4;

I don't think one can notice this outside of compiler plugins (I found it in https://github.com/oli-obk/rust-sa/blob/master/src/lib.rs#L26-34)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-syntaxextArea: Syntax extensions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions