summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2013-09-17std: fix win32 build error in os::env()Jeff Olson-1/+1
2013-09-17std: remove RtioStreamJeff Olson-5/+0
2013-09-17auto merge of #9244 : thestinger/rust/drop, r=catamorphismbors-76/+68
This doesn't close any bugs as the goal is to convert the parameter to by-value, but this is a step towards being able to make guarantees about `&T` pointers (where T is Freeze) to LLVM.
2013-09-16std: merge conflict cleanup from std::strJeff Olson-1/+0
2013-09-16std: docstring fixes in io::fileJeff Olson-239/+259
2013-09-16std: minor cleanup in some io_error descs in io::fileJeff Olson-2/+2
2013-09-16std: lots of docs for std::rt::io::fileJeff Olson-52/+298
i hope they don't bitrot
2013-09-16std: FsRequest.req_boilerplate() be &mut selfJeff Olson-17/+58
2013-09-16std: remove impl'd/commented-out fstat signaturesJeff Olson-4/+0
2013-09-16std: generlize & move io::file::suppressed_stat to io::ignore_io_errorJeff Olson-19/+19
2013-09-16std: correctly pass STDOUT in to naive_print test fnJeff Olson-1/+1
2013-09-16std: unignore some file io tests that work on windows, nowJeff Olson-6/+0
2013-09-16std: bind uv_fs_readdir(), flesh out DirectoryInfo and docs/cleanupJeff Olson-16/+173
2013-09-16std: expose more stat infoJeff Olson-7/+7
2013-09-16std: more work on from_c_multistring.. let it take an optional len paramJeff Olson-6/+18
2013-09-16std: clean up Dir/FileInfo inheritence and flesh out Dir InfoJeff Olson-59/+129
2013-09-16std: win32 os::env() str parsing to str::raw::from_c_multistring + testJeff Olson-10/+38
2013-09-16std: adding file::{stat,mkdir,rmdir}, FileInfo and FileReader/FileWriterJeff Olson-131/+269
add ignores for win32 tests on previous file io stuff...
2013-09-16merge cleanupJeff Olson-1/+2
2013-09-16std/rt: in-progress file io workJeff Olson-203/+661
std: remove unneeded field from RequestData struct std: rt::uv::file - map us_fs_stat & start refactoring calls into FsRequest std: stubbing out stat calls from the top-down into uvio std: us_fs_* operations are now by-val self methods on FsRequest std: post-rebase cleanup std: add uv_fs_mkdir|rmdir + tests & minor test cleanup in rt::uv::file WORKING: fleshing out FileStat and FileInfo + tests std: reverting test files.. refactoring back and cleanup...
2013-09-16auto merge of #9108 : blake2-ppc/rust/hazards-on-overflow, r=alexcrichtonbors-118/+152
Fix uint overflow bugs in std::{at_vec, vec, str} Closes #8742 Fix issue #8742, which summarized is: unsafe code in vec and str did assume that a reservation for `X + Y` elements always succeeded, and didn't overflow. Introduce the method `Vec::reserve_additional(n)` to make it easy to check for overflow in `Vec::push` and `Vec::push_all`. In std::str, simplify and remove a lot of the unsafe code and use `push_str` instead. With improvements to `.push_str` and the new function `vec::bytes::push_bytes`, it looks like this change has either no or positive impact on performance. I believe there are many places still where `v.reserve(A + B)` still can overflow. This by itself is not an issue unless followed by (unsafe) code that steps aside boundary checks.
2013-09-16switch Drop to `&mut self`Daniel Micay-76/+68
2013-09-17std::at_vec: Fix segfault on overflow when resizing ~[@T]blake2-ppc-5/+16
Easy to reproduce: let mut v = ~[@1]; v.resize(-1); // success a.k.a silent failure v.push(@2); // segfault
2013-09-17rt::io: Use vec::reserve_additionalblake2-ppc-1/+1
2013-09-17std::str: Fix overflow problems in unsafe codeblake2-ppc-105/+59
See issue #8742
2013-09-16auto merge of #9211 : klutzy/rust/win32-fix, r=alexcrichtonbors-26/+47
2013-09-16std::str: Add bench tests for StrVector::connect() and for str::push_strblake2-ppc-0/+19
2013-09-16std::vec: Add function vec::bytes::push_bytesblake2-ppc-0/+17
`push_bytes` is implemented with `ptr::copy_memory` here since this function is intended to be used to implement `.push_str()` for str, so we want to avoid the overhead.
2013-09-16std::vec: Fix hazards with uint overflows in unsafe codeblake2-ppc-6/+29
Issue #8742 Add the method `.reserve_additional(n: uint)`: Check for overflow in self.len() + n, and reserve that many elements (rounded up to next power of two). Does nothing if self.len() + n < self.capacity() already.
2013-09-16auto merge of #9192 : Kimundi/rust/master, r=huonwbors-16/+278
A SendStr is a string that can hold either a ~str or a &'static str. This can be useful as an optimization when an allocation is sometimes needed but the common case is statically known. Possible use cases include Maps with both static and owned keys, or propagating error messages across task boundaries. SendStr implements most basic traits in a way that hides the fact that it is an enum; in particular things like order and equality are only determined by the content of the wrapped strings. This basically reimplements #7599 and has a use case for replacing an similar type in `std::rt::logging` ( Added in #9180).
2013-09-16Corrected a few small style issuesMarvin Löbel-18/+43
Split up test function a bit
2013-09-16Add an SendStr typeMarvin Löbel-16/+253
A SendStr is a string that can hold either a ~str or a &'static str. This can be useful as an optimization when an allocation is sometimes needed but the common case is statically known. Possible use cases include Maps with both static and owned keys, or propagating error messages across task boundaries. SendStr implements most basic traits in a way that hides the fact that it is an enum; in particular things like order and equality are only determined by the content of the wrapped strings. Replaced std::rt:logging::SendableString with SendStr Added tests for using an SendStr as key in Hash- and Treemaps
2013-09-16std::num: Add uint::next_power_of_two_optblake2-ppc-1/+11
Like next_power_of_two, but returns None on overflow.
2013-09-15c_str: Add new method .as_str() -> Option<&str>Kevin Ballard-3/+74
Also rustify .as_bytes(), so it no longer calls libc::strlen() and is inlineable.
2013-09-16std::rt::uv::file: Enable tests on Win32klutzy-2/+0
Closes #8814.
2013-09-16std::rt::uv::uvio: Enable tests on Win32klutzy-2/+0
Closes #8816.
2013-09-16std::rt::io::net::tcp: Fix one tcp test on Win32klutzy-2/+7
Fixes `connect_error` part of #8811.
2013-09-16std::rt::uv::uvll: Fix uv_req_type on Win32klutzy-3/+27
Also enables request_sanity_check() test. Closes #8817
2013-09-16std::os: Use unicode for last_os_error() on Win32klutzy-10/+9
FormatMessageA may return non-ascii message, which is encoded as system code page, not utf8. This may cause `assert!(is_utf8(v))` failure on some non-English machines. This patch replaces it with FormatMessageW, which returns utf-16 message. Fixes `make check-stage2-std` failure on my machine. :)
2013-09-16std::rt::io::support: Fix ignored test on Win32klutzy-2/+1
Assumes drive C: exists. Closes #8812.
2013-09-15std::rt::io::file: Enable I/O tests on Win32klutzy-5/+3
Enable blocked tests which are now fixed by #9165. Closes #8810.
2013-09-15Remove {uint,int,u64,i64,...}::from_str,from_str_radixblake2-ppc-93/+69
Remove these in favor of the two traits themselves and the wrapper function std::from_str::from_str. Add the function std::num::from_str_radix in the corresponding role for the FromStrRadix trait.
2013-09-15Document all of the format! related macrosAlex Crichton-2/+74
2013-09-15Reduce the amount of complexity in format!Alex Crichton-0/+7
This renames the syntax-extension file to format from ifmt, and it also reduces the amount of complexity inside by defining all other macros in terms of format_args!
2013-09-15iter: add the edge case tests for `range` tooDaniel Micay-0/+10
2013-09-15rm some uses of the `advance` iterator methodDaniel Micay-2/+2
2013-09-15std::num: Remove `range_step` for each numeric typeblake2-ppc-296/+0
Replaced by `std::iter::range_step`
2013-09-15Use std::iter::range_stepblake2-ppc-35/+27
Use the iterator version instead of the old uint::/int::range_step functions.
2013-09-15iter: fix `RangeInclusive`'s `DoubleEndedIterator`Daniel Micay-3/+5
2013-09-15iter: fix `range_inclusive` when `start > stop`Daniel Micay-4/+10