3 use core::future::Future;
5 use core::task::{Context, Poll};
19 impl Future for Struct {
21 fn poll(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Self::Output> { Poll::Pending }
24 impl Future for Tuple {
26 fn poll(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Self::Output> { Poll::Pending }
30 type Output = Result<(), ()>;
32 fn poll(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Self::Output> {
37 async fn foo() -> Result<(), ()> {
41 async fn bar() -> Result<(), ()> {
42 foo()?; //~ ERROR the `?` operator can only be applied to values that implement `std::ops::Try`
46 async fn struct_() -> Struct {
50 async fn tuple() -> Tuple {
54 async fn baz() -> Result<(), ()> {
56 t?; //~ ERROR the `?` operator can only be applied to values that implement `std::ops::Try`
58 let _: i32 = tuple().0; //~ ERROR no field `0`
60 let _: i32 = struct_().a; //~ ERROR no field `a`
62 struct_().method(); //~ ERROR no method named
69 Tuple(_) => {} //~ ERROR mismatched types