| Age | Commit message (Collapse) | Author | Lines |
|
Move PosixPath into posix::Path.
|
|
|
|
|
|
|
|
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].
|
|
Fixes #5389 (new conventions for Path constructor)
|
|
Define the basic types, and the GenericPath trait.
This module is currently called path2. It will be renamed later.
|
|
This allows the indexing bounds check or other comparisons against an
element length to avoid a multiplication by the size.
|
|
casting the `uint` to an `int` can result in printing high values as
negative intege
|
|
This should be preferred to the libc `abort` function.
|
|
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.
|
|
They've been replaced by putting the name on the extern block.
#[abi = "foo"]
goes to
extern "foo" { }
Closes #9483.
|
|
This means the text is visible in rustdoc.
|
|
as per https://github.com/mozilla/rust/pull/9606#discussion_r6930872
|
|
This means the text is visible in rustdoc.
|
|
They've been replaced by putting the name on the extern block.
#[abi = "foo"]
goes to
extern "foo" { }
Closes #9483.
|
|
|
|
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`?)
|
|
|
|
This patch removes the code responsible for handling older CrateMap versions (as discussed during #9593). Only the new (safer) layout is supported now.
|
|
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.
|
|
|
|
|
|
This change was waiting for privacy to get sorted out, which should be true now
that #8215 has landed.
Closes #4427
|
|
This change was waiting for privacy to get sorted out, which should be true now
that #8215 has landed.
Closes #4427
|
|
The example for std::rand::random was still
using <float>, which got removed from Rust.
|
|
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?).
|
|
This was just a mistake that it was hidden.
|
|
|
|
|
|
|
|
This changes the implementation to instead use rt::io::native::process as well
as an example of using those bindings.
|
|
These two functions will be useful when replacing various other counterparts
used by std::io consumers.
|
|
Additionally, this moves the prelude imports of print/println from std::io to
std::rt::io.
Closes #6846
|
|
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.
|
|
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
```
|
|
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
|
|
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
|
|
|
|
|
|
|
|
This makes some headway on #3309, see commits for details.
|
|
|
|
|
|
|
|
|
|
|
|
This stops us relying on Default here.
|
|
|
|
|