rust/src/libstd/io
bors cb9c1e0e70 auto merge of #16498 : Kimundi/rust/inline-utf-encoding, r=alexcrichton
The first commit improves code generation through a few changes:
- The `#[inline]` attributes allow llvm to constant fold the encoding step away in certain situations. For example, code like this changes from a call to `encode_utf8` in a inner loop to the pushing of a byte constant:

 ```rust
let mut s = String::new();
for _ in range(0u, 21) {
        s.push_char('a');
}
```
- Both methods changed their semantic from causing run time failure if the target buffer is not large enough to returning `None` instead. This makes llvm no longer emit code for causing failure for these methods.
- A few debug `assert!()` calls got removed because they affected code generation due to unwinding, and where basically unnecessary with today's sound handling of `char` as a Unicode scalar value.

~~The second commit is optional. It changes the methods from regular indexing with the `dst[i]` syntax to unsafe indexing with `dst.unsafe_mut_ref(i)`. This does not change code generation directly - in both cases llvm is smart enough to see that there can never be an out-of-bounds access. But it makes it emit a `nounwind` attribute for the function. 
However, I'm not sure whether that is a real improvement, so if there is any objection to this I'll remove the commit.~~

This changes how the methods behave on a too small buffer, so this is a 

[breaking-change]
2014-08-17 04:42:32 +00:00
..
net librustc: Forbid external crates, imports, and/or items from being 2014-08-16 19:32:25 -07:00
buffered.rs std: Rename various slice traits for consistency 2014-08-13 11:30:14 -07:00
comm_adapters.rs std: Rename various slice traits for consistency 2014-08-13 11:30:14 -07:00
extensions.rs std: Rename slice::Vector to Slice 2014-08-13 11:30:14 -07:00
fs.rs std: Rename various slice traits for consistency 2014-08-13 11:30:14 -07:00
mem.rs std: Rename slice::Vector to Slice 2014-08-13 11:30:14 -07:00
mod.rs Optimized IR generation for UTF-8 and UTF-16 encoding 2014-08-16 21:13:39 +02:00
pipe.rs librustc: Forbid external crates, imports, and/or items from being 2014-08-16 19:32:25 -07:00
process.rs librustc: Forbid external crates, imports, and/or items from being 2014-08-16 19:32:25 -07:00
result.rs De-~[] Mem{Reader,Writer} 2014-04-06 15:40:01 -07:00
signal.rs auto merge of #16332 : brson/rust/slicestab, r=aturon 2014-08-14 05:36:25 +00:00
stdio.rs std: Rename various slice traits for consistency 2014-08-13 11:30:14 -07:00
tempfile.rs Register new snapshot 12e0f72 2014-08-08 07:55:00 -04:00
test.rs std: Clarify what timers do with zero and negative durations 2014-08-13 11:31:47 -07:00
timer.rs Fix various fallout from timer changes 2014-08-13 11:31:48 -07:00
util.rs librustc: Forbid external crates, imports, and/or items from being 2014-08-16 19:32:25 -07:00