1 // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
13 #![allow(dead_code, unused)]
14 #![feature(futures_api)]
21 fn as_result() -> Result<(), E> {
23 let K = Ok::<K, E>(K)?;
26 let _: Poll<K> = Poll::Ready::<Result<K, E>>(Ok(K))?;
28 // From Poll<Option<Result>>
29 let _: Poll<Option<K>> = Poll::Ready::<Option<Result<K, E>>>(None)?;
34 fn as_poll_result() -> Poll<Result<(), E>> {
36 let K = Ok::<K, E>(K)?;
39 let _: Poll<K> = Poll::Ready::<Result<K, E>>(Ok(K))?;
41 // From Poll<Option<Result>>
42 let _: Poll<Option<K>> = Poll::Ready::<Option<Result<K, E>>>(None)?;
47 fn as_poll_option_result() -> Poll<Option<Result<(), E>>> {
49 let K = Ok::<K, E>(K)?;
52 let _: Poll<K> = Poll::Ready::<Result<K, E>>(Ok(K))?;
54 // From Poll<Option<Result>>
55 let _: Poll<Option<K>> = Poll::Ready::<Option<Result<K, E>>>(None)?;
57 Poll::Ready(Some(Ok(())))