Skip to content

std::format! auto-dereferences pointers? #17988

Closed
@jkleint

Description

@jkleint

Is this a 'feature?'

fn main() {
    let x = 5i;
    assert_eq!(format!("{}", &x), format!("{:p}", &x));
}
task '<main>' failed at 'assertion failed: `(left == right) && (right == left)` (left: `5`, right: `0x7fffba8927f8`)', format_ptr.rs:3

This is with rustc 0.13.0-nightly (adb44f53d 2014-10-12 00:07:15 +0000).

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