File tree 2 files changed +42
-0
lines changed
2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ // edition:2018
2
+
3
+ use std:: { future:: Future , marker:: PhantomData } ;
4
+
5
+ fn spawn < T > ( future : T ) -> PhantomData < T :: Output >
6
+ where
7
+ T : Future ,
8
+ {
9
+ loop { }
10
+ }
11
+
12
+ #[ derive( Debug ) ]
13
+ struct IncomingServer { }
14
+ impl IncomingServer {
15
+ async fn connection_handler ( handler : impl Sized ) -> Result < Ok , std:: io:: Error > {
16
+ //~^ ERROR expected type, found variant `Ok` [E0573]
17
+ loop { }
18
+ }
19
+ async fn spawn ( & self , request_handler : impl Sized ) {
20
+ async move {
21
+ spawn ( Self :: connection_handler ( & request_handler) ) ;
22
+ } ;
23
+ }
24
+ }
25
+
26
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ error[E0573]: expected type, found variant `Ok`
2
+ --> $DIR/issue-106062.rs:15:64
3
+ |
4
+ LL | async fn connection_handler(handler: impl Sized) -> Result<Ok, std::io::Error> {
5
+ | ^^ not a type
6
+ |
7
+ help: try using the variant's enum
8
+ |
9
+ LL | async fn connection_handler(handler: impl Sized) -> Result<core::result::Result, std::io::Error> {
10
+ | ~~~~~~~~~~~~~~~~~~~~
11
+ LL | async fn connection_handler(handler: impl Sized) -> Result<std::result::Result, std::io::Error> {
12
+ | ~~~~~~~~~~~~~~~~~~~
13
+
14
+ error: aborting due to previous error
15
+
16
+ For more information about this error, try `rustc --explain E0573`.
You can’t perform that action at this time.
0 commit comments