Skip to content

Commit 2d88fa3

Browse files
committed
---
yaml --- r: 144475 b: refs/heads/try2 c: ac4f0df h: refs/heads/master i: 144473: 7f69067 144471: e3f598e v: v3
1 parent 449b70a commit 2d88fa3

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: c2bc59e0869889d9b996da99915f95ae89ddff00
8+
refs/heads/try2: ac4f0df12067e9aeb8ad8b7b953c69192daf0ddd
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libstd/repr.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,14 @@ impl TyVisitor for ReprVisitor {
282282
self.write_escaped_slice(*s);
283283
}
284284
}
285+
285286
fn visit_estr_uniq(&self) -> bool {
286287
do self.get::<~str> |s| {
287288
self.writer.write_char('~');
288289
self.write_escaped_slice(*s);
289290
}
290291
}
292+
291293
fn visit_estr_slice(&self) -> bool {
292294
do self.get::<&str> |s| {
293295
self.write_escaped_slice(*s);
@@ -322,13 +324,23 @@ impl TyVisitor for ReprVisitor {
322324
}
323325
}
324326

327+
#[cfg(stage0)]
325328
fn visit_ptr(&self, _mtbl: uint, _inner: *TyDesc) -> bool {
326329
do self.get::<*c_void> |p| {
327330
self.writer.write_str(fmt!("(0x%x as *())",
328331
*p as uint));
329332
}
330333
}
331334

335+
#[cfg(not(stage0))]
336+
fn visit_ptr(&self, mtbl: uint, _inner: *TyDesc) -> bool {
337+
do self.get::<*c_void> |p| {
338+
self.writer.write_str(fmt!("(0x%x as *", *p as uint));
339+
self.write_mut_qualifier(mtbl);
340+
self.writer.write_str("())");
341+
}
342+
}
343+
332344
fn visit_rptr(&self, mtbl: uint, inner: *TyDesc) -> bool {
333345
self.writer.write_char('&');
334346
self.write_mut_qualifier(mtbl);
@@ -613,6 +625,9 @@ fn test_repr() {
613625
exact_test(&(&mut x), "&mut 10");
614626
exact_test(&(@mut [1, 2]), "@mut [1, 2]");
615627

628+
exact_test(&(0 as *()), "(0x0 as *())");
629+
exact_test(&(0 as *mut ()), "(0x0 as *mut ())");
630+
616631
exact_test(&(1,), "(1,)");
617632
exact_test(&(@[1,2,3,4,5,6,7,8]),
618633
"@[1, 2, 3, 4, 5, 6, 7, 8]");

0 commit comments

Comments
 (0)