Skip to content

Commit f7ac8b7

Browse files
committed
---
yaml --- r: 85998 b: refs/heads/dist-snap c: 6655b3c h: refs/heads/master v: v3
1 parent d43647b commit f7ac8b7

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 0983ebe5310d4eb6d289f636f7ed0536c08bbc0e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 874611b348ba6fc18fb017c9f8a6a46b98ce6c76
9+
refs/heads/dist-snap: 6655b3c4620714e1a043be3b47f581719cefa12d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libstd/repr.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -412,10 +412,12 @@ impl<'self> TyVisitor for ReprVisitor<'self> {
412412
true
413413
}
414414

415-
fn visit_enter_class(&mut self, name: &str, _n_fields: uint,
415+
fn visit_enter_class(&mut self, name: &str, n_fields: uint,
416416
_sz: uint, _align: uint) -> bool {
417417
self.writer.write(name.as_bytes());
418-
self.writer.write(['{' as u8]);
418+
if n_fields != 0 {
419+
self.writer.write(['{' as u8]);
420+
}
419421
true
420422
}
421423

@@ -431,9 +433,11 @@ impl<'self> TyVisitor for ReprVisitor<'self> {
431433
true
432434
}
433435

434-
fn visit_leave_class(&mut self, _name: &str, _n_fields: uint,
436+
fn visit_leave_class(&mut self, _name: &str, n_fields: uint,
435437
_sz: uint, _align: uint) -> bool {
436-
self.writer.write(['}' as u8]);
438+
if n_fields != 0 {
439+
self.writer.write(['}' as u8]);
440+
}
437441
true
438442
}
439443

@@ -650,5 +654,5 @@ fn test_repr() {
650654
"(10u64, ~\"hello\")");
651655

652656
struct Foo;
653-
exact_test(&(~[Foo, Foo]), "~[repr::test_repr::Foo{}, repr::test_repr::Foo{}]");
657+
exact_test(&(~[Foo, Foo]), "~[repr::test_repr::Foo, repr::test_repr::Foo]");
654658
}

branches/dist-snap/src/libstd/vec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3682,11 +3682,11 @@ mod tests {
36823682

36833683
let xs = ~[Foo, Foo, Foo];
36843684
assert_eq!(fmt!("%?", xs.slice(0, 2).to_owned()),
3685-
~"~[vec::tests::Foo{}, vec::tests::Foo{}]");
3685+
~"~[vec::tests::Foo, vec::tests::Foo]");
36863686
36873687
let xs: [Foo, ..3] = [Foo, Foo, Foo];
36883688
assert_eq!(fmt!("%?", xs.slice(0, 2).to_owned()),
3689-
~"~[vec::tests::Foo{}, vec::tests::Foo{}]");
3689+
~"~[vec::tests::Foo, vec::tests::Foo]");
36903690
cnt = 0;
36913691
for f in xs.iter() {
36923692
assert!(*f == Foo);

branches/dist-snap/src/test/run-pass/ifmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub fn main() {
2929

3030
// Make sure there's a poly formatter that takes anything
3131
t!(format!("{:?}", 1), "1");
32-
t!(format!("{:?}", A), "A{}");
32+
t!(format!("{:?}", A), "A");
3333
t!(format!("{:?}", ()), "()");
3434
t!(format!("{:?}", @(~1, "foo")), "@(~1, \"foo\")");
3535

0 commit comments

Comments
 (0)