Skip to content

Commit 6bff18e

Browse files
committed
auto merge of #5098 : pkgw/rust/pr/issue4869, r=brson
See issue #4869. I'm not quite sure what constitutes "consensus from the core team" (cf. discussion in the issue), but this at least demonstrates that the proposed change is pretty straightforward. After this change, there are no new test failures. I've un-ignored the `to_str` vectors test; it's not at all obvious to me why it'd be problematic, and it passes on my Linux machine.
2 parents 292e946 + a712d82 commit 6bff18e

File tree

1 file changed

+5
-21
lines changed

1 file changed

+5
-21
lines changed

src/libcore/to_str.rs

+5-21
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -137,15 +137,6 @@ impl<A:ToStr> ToStr for @[A] {
137137
}
138138
}
139139
140-
impl<A:ToStr> ToStr for @A {
141-
#[inline(always)]
142-
pure fn to_str(&self) -> ~str { ~"@" + (**self).to_str() }
143-
}
144-
impl<A:ToStr> ToStr for ~A {
145-
#[inline(always)]
146-
pure fn to_str(&self) -> ~str { ~"~" + (**self).to_str() }
147-
}
148-
149140
#[cfg(test)]
150141
#[allow(non_implicitly_copyable_typarams)]
151142
mod tests {
@@ -170,19 +161,12 @@ mod tests {
170161
}
171162

172163
#[test]
173-
#[ignore]
174164
fn test_vectors() {
175165
let x: ~[int] = ~[];
176-
assert x.to_str() == ~"~[]";
177-
assert (~[1]).to_str() == ~"~[1]";
178-
assert (~[1, 2, 3]).to_str() == ~"~[1, 2, 3]";
166+
assert x.to_str() == ~"[]";
167+
assert (~[1]).to_str() == ~"[1]";
168+
assert (~[1, 2, 3]).to_str() == ~"[1, 2, 3]";
179169
assert (~[~[], ~[1], ~[1, 1]]).to_str() ==
180-
~"~[~[], ~[1], ~[1, 1]]";
181-
}
182-
183-
#[test]
184-
fn test_pointer_types() {
185-
assert (@1).to_str() == ~"@1";
186-
assert (~(true, false)).to_str() == ~"~(true, false)";
170+
~"[[], [1], [1, 1]]";
187171
}
188172
}

0 commit comments

Comments
 (0)