Skip to content

Commit

Permalink
fmt: Assume that we'll only ever see 32 or 64 bit pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
richo committed Apr 10, 2015
1 parent d8bb080 commit 64da4e1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/libcore/fmt/mod.rs
Expand Up @@ -861,8 +861,7 @@ impl<T> Pointer for *const T {
// The formats need two extra bytes, for the 0x
if cfg!(target_pointer_width = "32") {
f.width = Some(10);
}
if cfg!(target_pointer_width = "64") {
} else {
f.width = Some(18);
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/test/run-pass/fmt-pointer-trait.rs
Expand Up @@ -26,8 +26,7 @@ fn main() {
if cfg!(target_pointer_width = "32") {
assert_eq!(format!("{:#p}", p),
"0x00000000");
}
if cfg!(target_pointer_width = "64") {
} else {
assert_eq!(format!("{:#p}", p),
"0x0000000000000000");
}
Expand Down
3 changes: 1 addition & 2 deletions src/test/run-pass/ifmt.rs
Expand Up @@ -75,8 +75,7 @@ pub fn main() {
if cfg!(target_pointer_width = "32") {
t!(format!("{:#p}", 0x1234 as *const isize), "0x00001234");
t!(format!("{:#p}", 0x1234 as *mut isize), "0x00001234");
}
if cfg!(target_pointer_width = "64") {
} else {
t!(format!("{:#p}", 0x1234 as *const isize), "0x0000000000001234");
t!(format!("{:#p}", 0x1234 as *mut isize), "0x0000000000001234");
}
Expand Down

0 comments on commit 64da4e1

Please sign in to comment.