about summary refs log tree commit diff
path: root/src/libstd/rt
AgeCommit message (Collapse)AuthorLines
2013-10-15path2: Replace the path module outrightKevin Ballard-38/+46
Remove the old path. Rename path2 to path. Update all clients for the new path. Also make some miscellaneous changes to the Path APIs to help the adoption process.
2013-10-14Remove unused abi attributes.Steve Klabnik-1/+0
They've been replaced by putting the name on the extern block. #[abi = "foo"] goes to extern "foo" { } Closes #9483.
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-11Remove support for older CrateMap versionsFlorian Hahn-170/+10
2013-10-11De-pub some private runtime componentsAlex Crichton-28/+134
This change was waiting for privacy to get sorted out, which should be true now that #8215 has landed. Closes #4427
2013-10-10auto merge of #9749 : alexcrichton/rust/less-io, r=brsonbors-145/+1251
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-10Migrate users of io::fd_t to io::native::file::fd_tAlex Crichton-88/+34
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-25/+83
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 #9742 : alexcrichton/rust/issue-9739, r=brsonbors-2/+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-2/+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-19/+2
This makes some headway on #3309, see commits for details.
2013-10-09option: rewrite the API to use compositionDaniel Micay-26/+26
2013-10-09std::rand: Minor clean-up of comments & add a missing default method.Huon Wilson-1/+0
2013-10-09Convert rt::sched::new_sched_rng to use open/read/close rather than f*.Huon Wilson-16/+10
2013-10-09std::rand: make the windows OSRng more correct, remove some C++.Huon Wilson-1/+2
This lets the C++ code in the rt handle the (slightly) tricky parts of random number generation: e.g. error detection/handling, and using the values of the `#define`d options to the various functions.
2013-10-09std::rand: Add a trait for seeding RNGs: SeedableRng.Huon Wilson-2/+2
This provides 2 methods: .reseed() and ::from_seed that modify and create respecitively. Implement this trait for the RNGs in the stdlib for which this makes sense.
2013-10-09std::rand: Add OSRng, ReaderRng wrappers around the OS RNG & generic Readers ↵Huon Wilson-1/+55
respectively. The former reads from e.g. /dev/urandom, the latter just wraps any std::rt::io::Reader into an interface that implements Rng. This also adds Rng.fill_bytes for efficient implementations of the above (reading 8 bytes at a time is inefficient when you can read 1000), and removes the dependence on src/rt (i.e. rand_gen_seed) although this last one requires implementing hand-seeding of the XorShiftRng used in the scheduler on Linux/unixes, since OSRng relies on a scheduler existing to be able to read from /dev/urandom.
2013-10-09std::rand: Add an implementation of ISAAC64.Huon Wilson-1/+1
This is 2x faster on 64-bit computers at generating anything larger than 32-bits. It has been verified against the canonical C implementation from the website of the creator of ISAAC64. Also, move `Rng.next` to `Rng.next_u32` and add `Rng.next_u64` to take full advantage of the wider word width; otherwise Isaac64 will always be squeezed down into a u32 wasting half the entropy and offering no advantage over the 32-bit variant.
2013-10-08Make std::rt::io::extensions publicSteven Fackler-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-08rm useless fast_ffi attributesDaniel Micay-10/+0
this is no longer used by the compiler
2013-10-07Fix existing privacy/visibility violationsAlex Crichton-5/+26
This commit fixes all of the fallout of the previous commit which is an attempt to refine privacy. There were a few unfortunate leaks which now must be plugged, and the most horrible one is the current `shouldnt_be_public` module now inside `std::rt`. I think that this either needs a slight reorganization of the runtime, or otherwise it needs to just wait for the external users of these modules to get replaced with their `rt` implementations. Other fixes involve making things pub which should be pub, and otherwise updating error messages that now reference privacy instead of referencing an "unresolved name" (yay!).
2013-10-06auto merge of #9593 : fhahn/rust/logging-unsafe-removal, r=alexcrichtonbors-202/+305
This pull request changes to memory layout of the `CrateMap` struct to use static slices instead of raw pointers. Most of the discussion took place [here](https://github.com/fhahn/rust/commit/63b5975efa10af7df3df0a50d8d7f9c8d5bcf9e9#L1R92) . The memory layout of CrateMap changed, without bumping the version number in the struct. Another, more backward compatible, solution would be to keep the old code and increase the version number in the new struct. On the other hand, the `annihilate_fn` pointer was removed without bumping the version number recently. At the moment, the stage0 compiler does not use the new memory layout, which would lead the segfaults during stage0 compilation, so I've added a dummy `iter_crate_map` function for stage0, which does nothing. Again, this could be avoided if we'd bump the version number in the struct and keep the old code. I'd like to use a normal `for` loop [here](https://github.com/fhahn/rust/compare/logging-unsafe-removal?expand=1#L1R109), for child in children.iter() { do_iter_crate_map(child, |x| f(x), visited); } but for some reason this only yields `error: unresolved enum variant, struct or const 'Some'` and I have no idea why.
2013-10-06get_crate_map returns an OptionFlorian Hahn-23/+42
2013-10-05Make a task name use a `SendStr`, allowing for eitherMarvin Löbel-2/+2
static or owned strings
2013-10-05Add code for older crate map versions, bumped crate map version numberFlorian Hahn-38/+171
2013-10-05Use &'self str instead of raw char pointer in ModEntryFlorian Hahn-127/+99
2013-10-05Use slice representation for module entries in CrateMapFlorian Hahn-87/+47
Relaxe lifetime of CrateMap as well.
2013-10-05Use slice representation for child crate mapsFlorian Hahn-116/+135
2013-10-03Document logging and remove old functionsAlex Crichton-19/+2
This adds a large doc-block to the top of the std::logging module explaining how to use it. This is mostly just making sure that all the information in the manual's section about logging is also here (in case someone decides to look into this module first). This also removes the old console_{on,off} methods. As far as I can tell, the functions were only used by the compiler, and there's no reason for them to be used because they're all turned off by default anyway (maybe they were turned on by default at some point...) I believe that this is the final nail in the coffin and closes #5021
2013-10-03Close out #9155Steven Fackler-13/+9
Add a test to make sure it works and switch a private struct over to a newtype. Closes #9155
2013-10-02Stop using newtype wrappers in std::rt::ioSteven Fackler-30/+48
UnboundedPipeStream is still a newtype since process::set_stdio needs to look into its internals. Closes #9667
2013-10-02auto merge of #9665 : alexcrichton/rust/snapshot, r=brsonbors-2/+2
Uses the new snapshots to kill the old `loop` and introduce the new `continue`.
2013-10-01auto merge of #9578 : alexcrichton/rust/un-ignore-libuv-process-tests, r=brsonbors-142/+2
Closes #9341
2013-10-01Move the rt::io::process tests to run-passAlex Crichton-142/+2
Closes #9341
2013-10-01Migrate users of 'loop' to 'continue'Alex Crichton-2/+2
Closes #9467
2013-09-30std: Remove usage of fmt!Alex Crichton-191/+179
2013-09-30std::rt::uv::net: Enable tests on Win32klutzy-4/+0
Closes #8815.
2013-09-29Put a newline after each logging messageAlex Crichton-1/+1
2013-09-27auto merge of #9574 : FlaPer87/rust/suppress_warnings, r=metajackbors-1/+0
Small change that suppresses a warning because of an unused import.
2013-09-27auto merge of #9562 : alexcrichton/rust/snapshots, r=thestingerbors-12/+0
2013-09-27auto merge of #9559 : sfackler/rust/more-visibility, r=alexcrichtonbors-11/+11
2013-09-27Suppress warning by removing unused importFlavio Percoco-1/+0
2013-09-27Register new snapshotsAlex Crichton-12/+0