Skip to content

Inconsistent analysis results for unsafe blocks and operators #64093

Closed
@rchaser53

Description

@rchaser53

related: rust-lang/rustfmt#3770
rust playground link: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=ef4769175cb5b4febb445b05c1e27b82

The second !unsafe block return &&bool. I think the second block should return bool.

fn return_bool() -> bool {
    unsafe { false }            // expected (), found bool
        && !unsafe { true }     // expected bool found &&bool
        && !unsafe { false }    // expected bool found bool
}

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