We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
0x5a83172c, 7fff5a83172c
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
The text was updated successfully, but these errors were encountered:
Possibly related to #22700, the most recent change to the fmt module? cc @nrc
fmt
The formatting is what we'd see if the pointer were cast to a u32 instead of a usize.
u32
usize
Sorry, something went wrong.
std: Don't accidentally truncate *T formatting
262f350
Just a mistaken u32 cast instead of usize Closes rust-lang#22854
Fixed in #22901
Successfully merging a pull request may close this issue.
This sample code prints
0x5a83172c, 7fff5a83172c
, where the pointer's debug doesn't include the first 4 characters of its address.My rustc version:
The text was updated successfully, but these errors were encountered: