These functions are for working with a string representation of the path
even if it's not UTF-8 encoded. They replace invalid UTF-8 sequences
with the replacement char.
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].
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.
This stops labeling everything as "is private" when in fact the destination may
be public. Instead, the clause "is inaccessible" is used and the private part of
the flag is called out with a "is private" message.
Closes#9793
r? anyone.
You can see a bit more discussion on #7655.
This does not close any ticket; I am just scratching an itch. Note in particular that I picked the value `{:>9} ns/iter` pretty much out of a hat. :)
(scratching an itch.)
Rebased and updated.
Fixed bug: omitted field init from embedded struct literal in a test.
Fixed bug: int underflow during padding length calculation.
In addition, the renderer will add comments to structs and enums saying
that fields or variants have been stripped.
The comments are currently
```rust
// some fields stripped
// some variants stripped
```
I was thinking of changing that to "some private..." but passes other than
strip-private may strip fields or variants as well.
cc @alexcrichton
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`?)
Example:
void ({ i64, %tydesc*, i8*, i8*, i8 }*, i64*, %"struct.std::fmt::Formatter[#1]"*)*
Before, we would print 20 levels deep due to recursion in the type
definition.