diff options
| author | bors <bors@rust-lang.org> | 2014-06-28 18:21:34 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-06-28 18:21:34 +0000 |
| commit | de337f3ddfbef800a8cf731e0b593e341af1e3e5 (patch) | |
| tree | 7f35eb443f0b58d81dc39f6d19da42bac4645d7e /src/libstd | |
| parent | b47f2226a25654c5b781d27a91f2fa5274b3a347 (diff) | |
| parent | 05e3248a7974f55b64f75a2483b37ff8c001a4ff (diff) | |
| download | rust-de337f3ddfbef800a8cf731e0b593e341af1e3e5.tar.gz rust-de337f3ddfbef800a8cf731e0b593e341af1e3e5.zip | |
auto merge of #15191 : pcwalton/rust/variance-in-trait-matching, r=huonw
I believe that #5781 got fixed by the DST work. It duplicated the variance inference work in #12828. Therefore, all that is left in #5781 is adding a test. Closes #5781. r? @huonw
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/io/comm_adapters.rs | 5 | ||||
| -rw-r--r-- | src/libstd/task.rs | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/libstd/io/comm_adapters.rs b/src/libstd/io/comm_adapters.rs index c03fbf302d7..cd5887b7add 100644 --- a/src/libstd/io/comm_adapters.rs +++ b/src/libstd/io/comm_adapters.rs @@ -183,7 +183,10 @@ mod test { writer.write_be_u32(42).unwrap(); let wanted = vec![0u8, 0u8, 0u8, 42u8]; - let got = task::try(proc() { rx.recv() }).unwrap(); + let got = match task::try(proc() { rx.recv() }) { + Ok(got) => got, + Err(_) => fail!(), + }; assert_eq!(wanted, got); match writer.write_u8(1) { diff --git a/src/libstd/task.rs b/src/libstd/task.rs index dad241002f8..8ccded6681b 100644 --- a/src/libstd/task.rs +++ b/src/libstd/task.rs @@ -630,9 +630,11 @@ mod test { let mut reader = ChanReader::new(rx); let stdout = ChanWriter::new(tx); - TaskBuilder::new().stdout(box stdout as Box<Writer + Send>).try(proc() { - print!("Hello, world!"); - }).unwrap(); + let r = TaskBuilder::new().stdout(box stdout as Box<Writer + Send>) + .try(proc() { + print!("Hello, world!"); + }); + assert!(r.is_ok()); let output = reader.read_to_str().unwrap(); assert_eq!(output, "Hello, world!".to_string()); |
