Skip to content

Debug formatting for pointers is truncated #22854

Closed
@SSheldon

Description

@SSheldon
fn main() {
    let x = 0;
    let p = &x as *const i32;
    println!("{:?}, {:x}", p, p as usize);
}

This sample code prints 0x5a83172c, 7fff5a83172c, where the pointer's debug doesn't include the first 4 characters of its address.

My rustc version:

$ rustc --version --verbose
rustc 1.0.0-nightly (4db0b3246 2015-02-25) (built 2015-02-25)
binary: rustc
commit-hash: 4db0b32467535d718d6474de7ae8d1007d900818
commit-date: 2015-02-25
build-date: 2015-02-25
host: x86_64-apple-darwin
release: 1.0.0-nightly

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