summary refs log tree commit diff
path: root/src/libstd
AgeCommit message (Collapse)AuthorLines
2013-10-15path2: Extract posix/windows into their own filesKevin Ballard-1639/+1693
Move PosixPath into posix::Path.
2013-10-15path2: Add tests for the [u8]-based methodsKevin Ballard-270/+560
2013-10-15path2: Update all the tests for the new [u8]-based approachKevin Ballard-179/+189
2013-10-15path2: Reimplement PosixPath in terms of ~[u8]Kevin Ballard-138/+154
2013-10-15path2: Start reimplementing in terms of ~[u8] instead of ~strKevin Ballard-88/+357
As documented in #7225, we cannot rely on paths being representable in utf-8. Specifically, Linux allows anything (besides NUL) in a path. Redesign GenericPath in light of this. PosixPath hasn't been reimplemented yet for ~[u8].
2013-10-15path2: Implement PosixPathKevin Ballard-1/+770
Fixes #5389 (new conventions for Path constructor)
2013-10-15Initial sketching out of the new path moduleKevin Ballard-0/+286
Define the basic types, and the GenericPath trait. This module is currently called path2. It will be renamed later.
2013-10-15use element count in slices, not size in bytesDaniel Micay-21/+109
This allows the indexing bounds check or other comparisons against an element length to avoid a multiplication by the size.
2013-10-15fix bounds checking failure messageDaniel Micay-1/+1
casting the `uint` to an `int` can result in printing high values as negative intege
2013-10-14add an `abort` intrinsicDaniel Micay-0/+3
This should be preferred to the libc `abort` function.
2013-10-14std::rt: Fix the set up of the main thread so that it doesn't try to steal workBrian Anderson-2/+8
This is causing really awful scheduler behavior where the main thread scheduler is continually waking up, stealing work, discovering it can't actually run the work, and sending it off to another scheduler.
2013-10-14auto merge of #9606 : steveklabnik/rust/abi_removal, r=alexcrichtonbors-33/+0
They've been replaced by putting the name on the extern block. #[abi = "foo"] goes to extern "foo" { } Closes #9483.
2013-10-14auto merge of #9848 : huonw/rust/move-trait-doc, r=alexcrichtonbors-302/+303
This means the text is visible in rustdoc.
2013-10-14Removing ccdeclSteve Klabnik-28/+28
as per https://github.com/mozilla/rust/pull/9606#discussion_r6930872
2013-10-14std::vec: move documentation from impls to traits.Huon Wilson-302/+303
This means the text is visible in rustdoc.
2013-10-14Remove unused abi attributes.Steve Klabnik-61/+28
They've been replaced by putting the name on the extern block. #[abi = "foo"] goes to extern "foo" { } Closes #9483.
2013-10-14std::libc: rustdoc indicates reexports nowScott Lawrence-3/+2
2013-10-12auto merge of #9608 : hmarr/rust/vec-get-opt, r=huonwbors-0/+18
This adds `get_opt` to `std::vec`, which looks up an item by index and returns an `Option`. If the given index is out of range, `None` will be returned, otherwise a `Some`-wrapped item will be returned. Example use case: ```rust use std::os; fn say_hello(name: &str) { println(fmt!("Hello, %s", name)); } fn main(){ // Try to get the first cmd line arg, but default to "World" let args = os::args(); let default = ~"World"; say_hello(*args.get_opt(1).unwrap_or(&default)); } ``` If there's an existing way of implementing this pattern that's cleaner, I'll happily close this. I'm also open to naming suggestions (`index_opt`?)
2013-10-12rc: fix docstringDaniel Micay-1/+1
2013-10-11auto merge of #9809 : fhahn/rust/remove-old-cratemap-code, r=alexcrichtonbors-170/+10
This patch removes the code responsible for handling older CrateMap versions (as discussed during #9593). Only the new (safer) layout is supported now.
2013-10-11auto merge of #9794 : thestinger/rust/rc, r=alexcrichtonbors-0/+384
I've left out a way to construct from a `Send` type until #9509 is resolved. I am confident that this interface can remain backwards compatible though, assuming we name the `Pointer` trait method `borrow`. When there is a way to convert from `Send` (`from_send`), a future RAII-based `Mut` type can be used with this to implemented a mutable reference-counted pointer. For now, I've left around the `RcMut` type but it may drastically change or be removed.
2013-10-11clean up the `Rc`/`RcMut` types and move to libstdDaniel Micay-0/+384
2013-10-11Remove support for older CrateMap versionsFlorian Hahn-170/+10
2013-10-11auto merge of #9803 : alexcrichton/rust/less-pub2, r=brsonbors-98/+113
This change was waiting for privacy to get sorted out, which should be true now that #8215 has landed. Closes #4427
2013-10-11De-pub some private runtime componentsAlex Crichton-98/+113
This change was waiting for privacy to get sorted out, which should be true now that #8215 has landed. Closes #4427
2013-10-10Fix usage of <float> in docsVolker Mische-1/+1
The example for std::rand::random was still using <float>, which got removed from Rust.
2013-10-10auto merge of #9749 : alexcrichton/rust/less-io, r=brsonbors-977/+1336
This implements a number of the baby steps needed to start eliminating everything inside of `std::io`. It turns out that there are a *lot* of users of that module, so I'm going to try to tackle them separately instead of bringing down the whole system all at once. This pull implements a large amount of unimplemented functionality inside of `std::rt::io` including: * Native file I/O (file descriptors, *FILE) * Native stdio (through the native file descriptors) * Native processes (extracted from `std::run`) I also found that there are a number of users of `std::io` which desire to read an input line-by-line, so I added an implementation of `read_until` and `read_line` to `BufferedReader`. With all of these changes in place, I started to axe various usages of `std::io`. There's a lot of one-off uses here-and-there, but the major use-case remaining that doesn't have a fantastic solution is `extra::json`. I ran into a few compiler bugs when attempting to remove that, so I figured I'd come back to it later instead. There is one fairly major change in this pull, and it's moving from native stdio to uv stdio via `print` and `println`. Unfortunately logging still goes through native I/O (via `dumb_println`). This is going to need some thinking, because I still want the goal of logging/printing to be 0 allocations, and this is not possible if `io::stdio::stderr()` is called on each log message. Instead I think that this may need to be cached as the `logger` field inside the `Task` struct, but that will require a little more workings to get right (this is also a similar problem for print/println, do we cache `stdout()` to not have to re-create it every time?).
2013-10-10Make the file::DirectoryInfo trait publicAlex Crichton-1/+1
This was just a mistake that it was hidden.
2013-10-10Remove some users of io::file_readerAlex Crichton-4/+24
2013-10-10Remove usage of io::FILE_writerAlex Crichton-49/+13
2013-10-10Migrate users of io::fd_t to io::native::file::fd_tAlex Crichton-101/+40
2013-10-10Move std::run off of std::ioAlex Crichton-769/+65
This changes the implementation to instead use rt::io::native::process as well as an example of using those bindings.
2013-10-10Implement BufferedReader.{read_until, read_line}Alex Crichton-7/+65
These two functions will be useful when replacing various other counterparts used by std::io consumers.
2013-10-10Implement rt::io::stdioAlex Crichton-26/+84
Additionally, this moves the prelude imports of print/println from std::io to std::rt::io. Closes #6846
2013-10-09auto merge of #9780 : sfackler/rust/extensions2, r=alexcrichtonbors-1/+1
This works around #9779, but is probably the right thing to do anyways since that's the module where all of the documentation for those traits lives.
2013-10-09auto merge of #9774 : sebcrozet/rust/master, r=huonwbors-2/+1
The minimum (negative) value of a float is `-Bounded::max_value()`, not `Bounded::min_value()`. Otherwise the following has an incorrect behavior: ```rust let a = -1.0f64; let b: f32 = NumCast::from(a); // incorrectly returns None ```
2013-10-09auto merge of #9742 : alexcrichton/rust/issue-9739, r=brsonbors-40/+8
This changes an `assert_once_ever!` assertion to just a plain old assertion around an atomic boolean to ensure that one particular runtime doesn't attempt to exit twice. Closes #9739
2013-10-09Don't abort if the runtime is run twice.Alex Crichton-40/+8
This changes an `assert_once_ever!` assertion to just a plain old assertion around an atomic boolean to ensure that one particular runtime doesn't attempt to exit twice. Closes #9739
2013-10-09Implement io::native::processAlex Crichton-0/+752
2013-10-09Implement io::native::stdioAlex Crichton-0/+67
2013-10-09Implement io::native::fileAlex Crichton-25/+230
2013-10-09auto merge of #9664 : alexcrichton/rust/logging, r=huonwbors-46/+90
This makes some headway on #3309, see commits for details.
2013-10-09option: rewrite the API to use compositionDaniel Micay-117/+82
2013-10-09std::rand: Minor clean-up of comments & add a missing default method.Huon Wilson-3/+5
2013-10-09std::rand: remove seed_task_rng and RUST_SEED.Huon Wilson-76/+9
2013-10-09std::rand: Make Rng.next_u32 non-default, waiting for #7771.Huon Wilson-6/+11
2013-10-09std::rand::os: use the externfn! macro for the Windows RNG.Huon Wilson-22/+16
2013-10-09std::rand::reseeding: seed the reseeder in the SeedableRng impl.Huon Wilson-12/+13
This stops us relying on Default here.
2013-10-09std::rand::reader: describe cfg!(endianness).Huon Wilson-0/+4
2013-10-09std::rand: Correct the implementation of Rand for f32 & f64.Huon Wilson-8/+29