about summary refs log tree commit diff
path: root/src/libtest
AgeCommit message (Collapse)AuthorLines
2014-02-24Remove std::from_str::FromStr from the preludeBrendan Zabarauskas-0/+1
2014-02-24Move extra::json to libserializeAlex Crichton-3/+2
This also inverts the dependency between libserialize and libcollections. cc #8784
2014-02-24auto merge of #12412 : alexcrichton/rust/deriving-show, r=huonwbors-10/+10
This commit removes deriving(ToStr) in favor of deriving(Show), migrating all impls of ToStr to fmt::Show. Most of the details can be found in the first commit message. Closes #12477
2014-02-23Remove all ToStr impls, add Show implsAlex Crichton-10/+10
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-23auto merge of #12328 : nick29581/rust/abi, r=alexcrichtonbors-2/+2
2014-02-24All uses of `extern fn` should mean `extern "C" fn`. Closes #9309.Nick Cameron-2/+2
2014-02-23Merge remote-tracking branch 'brson/ratcher'Brian Anderson-1/+1
2014-02-22Warn about unnecessary parentheses upon assignmentEduard Bopp-1/+1
Closes #12366. Parentheses around assignment statements such as let mut a = (0); a = (1); a += (2); are not necessary and therefore an unnecessary_parens warning is raised when statements like this occur. The warning mechanism was refactored along the way to allow for code reuse between the routines for checking expressions and statements. Code had to be adopted throughout the compiler and standard libraries to comply with this modification of the lint.
2014-02-21test: 'ratcher' is not a wordBrian Anderson-1/+1
2014-02-21Move time out of extra (cc #8784)Arcterus-1/+2
2014-02-20Mass rename if_ok! to try!Alex Crichton-46/+46
This "bubble up an error" macro was originally named if_ok! in order to get it landed, but after the fact it was discovered that this name is not exactly desirable. The name `if_ok!` isn't immediately clear that is has much to do with error handling, and it doesn't look fantastic in all contexts (if if_ok!(...) {}). In general, the agreed opinion about `if_ok!` is that is came in as subpar. The name `try!` is more invocative of error handling, it's shorter by 2 letters, and it looks fitting in almost all circumstances. One concern about the word `try!` is that it's too invocative of exceptions, but the belief is that this will be overcome with documentation and examples. Close #12037
2014-02-20move extra::test to libtestLiigo Zhuang-0/+1577