summary refs log tree commit diff
path: root/src/test/run-pass/new-impl-syntax.rs
AgeCommit message (Collapse)AuthorLines
2014-02-23Remove all ToStr impls, add Show implsAlex Crichton-6/+8
This commit changes the ToStr trait to: impl<T: fmt::Show> ToStr for T { fn to_str(&self) -> ~str { format!("{}", *self) } } The ToStr trait has been on the chopping block for quite awhile now, and this is the final nail in its coffin. The trait and the corresponding method are not being removed as part of this commit, but rather any implementations of the `ToStr` trait are being forbidden because of the generic impl. The new way to get the `to_str()` method to work is to implement `fmt::Show`. Formatting into a `&mut Writer` (as `format!` does) is much more efficient than `ToStr` when building up large strings. The `ToStr` trait forces many intermediate allocations to be made while the `fmt::Show` trait allows incremental buildup in the same heap allocated buffer. Additionally, the `fmt::Show` trait is much more extensible in terms of interoperation with other `Writer` instances and in more situations. By design the `ToStr` trait requires at least one allocation whereas the `fmt::Show` trait does not require any allocations. Closes #8242 Closes #9806
2014-02-07Added tests to make tidyDerek Guenther-0/+10
2014-01-11Remove re-exports of std::io::stdio::{print, println} in the prelude.Brendan Zabarauskas-2/+2
The `print!` and `println!` macros are now the preferred method of printing, and so there is no reason to export the `stdio` functions in the prelude. The functions have also been replaced by their macro counterparts in the tutorial and other documentation so that newcomers don't get confused about what they should be using.
2013-09-30rpass: Remove usage of fmt!Alex Crichton-1/+1
2013-05-29librustc: Stop reexporting the standard modules from prelude.Patrick Walton-2/+2
2013-05-03add gitattributes and fix whitespace issuesDaniel Micay-1/+0
2013-03-22test: Remove `pure` from the test suitePatrick Walton-2/+2
2013-02-03core: convert ToStr::to_str to take explicit &selfErick Tryzelaar-2/+2
2013-02-01check-fast fallout from removing export, r=burningtreeGraydon Hoare-1/+1
2013-01-29libsyntax: Implement the `impl Trait for Type` syntaxPatrick Walton-0/+26