about summary refs log tree commit diff
path: root/src/rustllvm/PassWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-04-27 16:01:39 -0700
committerbors <bors@rust-lang.org>2014-04-27 16:01:39 -0700
commit8b24964012cffda83deb7749fdddd047a4144df4 (patch)
treea970d386eac88b33f399cd6a7c00129b4fcf97c3 /src/rustllvm/PassWrapper.cpp
parent479b8a812c011ee103b52cab665a3d6f02c40ddf (diff)
parenta7b8a13e143c7e9c071149648d4681095a4abe4a (diff)
downloadrust-8b24964012cffda83deb7749fdddd047a4144df4.tar.gz
rust-8b24964012cffda83deb7749fdddd047a4144df4.zip
auto merge of #13799 : m-r-r/rust/patch-std-io-standard_error, r=alexcrichton
Hello,

With the latest version of Rust, calling to the function [`std::io::standard_error()`](http://static.rust-lang.org/doc/master/std/io/fn.standard_error.html) succeeds only if the value of the argument is `EndOfFile`, `IoUnavailable` or `InvalidInput`. If the function is called with another value as argument, it fails without message.

Here is a piece of code that reproduces the problem:

```rust
use std::io::{standard_error,EndOfFile,FileNotFound,PermissionDenied};

fn main() {
     println!("Error 1: {}", standard_error(EndOfFile)); // does not fail
     println!("Error 2: {}", standard_error(FileNotFound)); // fails
     println!("Error 3: {}", standard_error(PermissionDenied)); //fails
}
```
This was because the `IoErrorKind` passed as argument wasn't matched against all the possible values.

I added the missing branches in the `match` statement inside the function, and i removed the call to the `fail!()` macro. I rebuilt the crate with the latest `rustc` version and it seems to works.
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions