summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2013-09-19auto merge of #9279 : erickt/rust/master, r=alexcrichtonbors-19/+1
`Some(5).or_{default,zero}` can be easily replaced with `Some(Some(5).unwrap_or_default())`.
2013-09-19Rename the NaN and is_NaN methods to lowercase.Chris Morgan-115/+115
This is for consistency in naming conventions. - ``std::num::Float::NaN()`` is changed to ``nan()``; - ``std::num::Float.is_NaN()`` is changed to ``is_nan()``; and - ``std::num::strconv::NumStrConv::NaN()`` is changed to ``nan()``. Fixes #9319.
2013-09-19auto merge of #9292 : blake2-ppc/rust/borrow-ref-eq, r=huonwbors-1/+15
std::borrow: Use raw pointer comparison for `ref_eq` Compare as `*T` in `ref_eq` instead of casting to uint, to match what std::ptr does.
2013-09-19auto merge of #9291 : jzelinskie/rust/remove-cond, r=alexcrichtonbors-53/+53
This is my first contribution, so please point out anything that I may have missed. I consulted IRC and settled on `match () { ... }` for most of the replacements.
2013-09-18auto merge of #9280 : alexcrichton/rust/less-c++, r=brsonbors-4/+17
Some of the functions could be converted to rust, but the functions dealing with signals were moved to rust_builtin.cpp instead (no reason to keep the original file around for one function). Closes #2674 Because less C++ is better C++!
2013-09-19Replace unreachable() calls with unreachable!().Chris Morgan-34/+4
This is the second of two parts of #8991, now possible as a new snapshot has been made. (The first part implemented the unreachable!() macro; it was #8992, 6b7b8f2682.) ``std::util::unreachable()`` is removed summarily; any code which used it should now use the ``unreachable!()`` macro. Closes #9312. Closes #8991.
2013-09-18Remove rust_run_program.cppAlex Crichton-4/+17
Some of the functions could be converted to rust, but the functions dealing with signals were moved to rust_builtin.cpp instead (no reason to keep the original file around for one function). Closes #2674
2013-09-18libstd/librustc: Make the crate_map a weak symbol that libstd links against.Luqman Aden-1/+2
2013-09-18Implement process bindings to libuvAlex Crichton-67/+1034
This is a re-landing of #8645, except that the bindings are *not* being used to power std::run just yet. Instead, this adds the bindings as standalone bindings inside the rt::io::process module. I made one major change from before, having to do with how pipes are created/bound. It's much clearer now when you can read/write to a pipe, as there's an explicit difference (different types) between an unbound and a bound pipe. The process configuration now takes unbound pipes (and consumes ownership of them), and will return corresponding pipe structures back if spawning is successful (otherwise everything is destroyed normally).
2013-09-18librustc/libstd: No longer pass crate_map to start.Luqman Aden-2/+74
2013-09-18auto merge of #9296 : alexcrichton/rust/snapshots, r=cmrbors-1445/+13
huzzah!
2013-09-18Register new snapshotsAlex Crichton-1445/+13
2013-09-18auto merge of #9277 : crabtw/rust/mips, r=brsonbors-27/+140
This patch fixes some errors of MIPS target, however, MIPS C ABI is still broken. I will send another PR to fix the problem. Because MIPS target has no "generic" CPU name, I add --target-cpu and --target-feature to RUST_FLAGS. In order to workaround the "compact frame descriptions incompatible with DWARF2 .eh_frame" problem, the linker I used is CXX but not CC.
2013-09-18auto merge of #9275 : blake2-ppc/rust/float-from-str, r=thestingerbors-211/+187
std: Remove {float,f64,f32}::from_str in favor of from_str in the prelude Like issue #9209, remove float::{from_str, from_str_radix} in favor of the two corresponding traits. The same for modules f64 and f32. New usage is: from_str::<float>("1.2e34")
2013-09-18Remove and replace cond! Closes #9282.Jimmy Zelinskie-53/+53
2013-09-17std: Fix an invalid read in from_c_multistringBrian Anderson-2/+2
When `count` is `Some` this function was reading a byte past the end of the buffer.
2013-09-18std::borrow: Use raw pointer comparison for `ref_eq`blake2-ppc-1/+15
Compare as `*T` in `ref_eq` instead of casting to uint, to match what std::ptr does.
2013-09-17Document a few undocumented modules in libstdAlex Crichton-51/+336
Hopefull this will make our libstd docs appear a little more "full".
2013-09-17std: Remove Option.or_{default,zero}Erick Tryzelaar-19/+1
These can be replaced with `Some(option.or_default())`.
2013-09-18fix compilation errors of mips targetJyun-Yan You-27/+140
2013-09-18std: Remove {float,f64,f32}::from_str in favor of from_strblake2-ppc-211/+187
Like issue #9209, remove float::{from_str, from_str_radix} in favor of the two corresponding traits. The same for modules f64 and f32. New usage is from_str::<float>("1.2e34")
2013-09-17auto merge of #9235 : olsonjeffery/rust/newrt_file_io_1, r=thestingerbors-231/+1386
A quick rundown: - added `file::{readdir, stat, mkdir, rmdir}` - Added access-constrained versions of `FileStream`; `FileReader` and `FileWriter` respectively - big rework in `uv::file` .. most actions are by-val-self methods on `FsRequest`; `FileDescriptor` has gone the way of the dinosaurs - playing nice w/ homing IO (I just copied ecr's work, hehe), etc - added `FileInfo` trait, with an impl for `Path` - wrapper for file-specific actions, with the file path always implied by self's value - has the means to create `FileReader` & `FileWriter` (this isn't exposed in the top-level free function API) - has "safe" wrappers for `stat()` that won't throw in the event of non-existence/error (in this case, I mean `is_file` and `exists`) - actions should fail if done on non-regular-files, as appropriate - added `DirectoryInfo` trait, with an impl for `Path` - pretty much ditto above, but for directories - added `readdir` (!!) to iterate over entries in a dir as a `~[Path]` (this was *brutal* to get working) ...<del>and lots of other stuff</del>not really. Do your worst!
2013-09-17std: fix win32 build issue re: multistring parsingJeff Olson-1/+1
2013-09-17std: whitespace clean up io::file docsJeff Olson-52/+52
2013-09-17remove unnecessary transmutesDaniel Micay-27/+8
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