Skip to content

New test for loading a pointer as part of a read #1706

Closed
@oli-obk

Description

@oli-obk

@eddyb would like

use std::mem::transmute;
fn main() {
    for &my_bool in &[true, false] {
        unsafe {
            println!("{}", transmute::<_, &str>(!-(my_bool as i128) & transmute::<_, i128>("false !") | -(my_bool as i128) & transmute::<_, i128>("true !")));
        }
    }
}

to be in the miri test suite.

The diagnostic is also wrong, it's actually that we want to put two pointers into a single i128 immediate value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-intptrcastArea: affects int2ptr and ptr2int casts

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions