File tree 2 files changed +38
-0
lines changed
compiler/rustc_trait_selection/src/traits/select
2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -3016,6 +3016,7 @@ fn bind_generator_hidden_types_above<'tcx>(
3016
3016
counter += 1 ;
3017
3017
tcx. mk_re_late_bound ( current_depth, br)
3018
3018
}
3019
+ ty:: RePlaceholder ( _) => r,
3019
3020
r => bug ! ( "unexpected region: {r:?}" ) ,
3020
3021
} )
3021
3022
}
Original file line number Diff line number Diff line change
1
+ // run-pass
2
+ // compile-flags: --edition=2018 -Zdrop-tracking-mir=yes
3
+
4
+ use std:: future:: { Future , Ready } ;
5
+ async fn read ( ) { }
6
+ async fn connect < A : ToSocketAddr > ( addr : A ) {
7
+ let _ = addr. to_socket_addr ( ) . await ;
8
+ }
9
+ pub trait ToSocketAddr {
10
+ type Future : Future ;
11
+ fn to_socket_addr ( & self ) -> Self :: Future ;
12
+ }
13
+ impl ToSocketAddr for & ( ) {
14
+ type Future = Ready < ( ) > ;
15
+ fn to_socket_addr ( & self ) -> Self :: Future {
16
+ unimplemented ! ( )
17
+ }
18
+ }
19
+ struct Server ;
20
+ impl Server {
21
+ fn and_then < F > ( self , _fun : F ) -> AndThen < F > {
22
+ unimplemented ! ( )
23
+ }
24
+ }
25
+ struct AndThen < F > {
26
+ _marker : std:: marker:: PhantomData < F > ,
27
+ }
28
+ pub async fn run < F > ( _: F ) {
29
+ let _ = connect ( & ( ) ) . await ;
30
+ }
31
+ fn main ( ) {
32
+ let _ = async {
33
+ let server = Server ;
34
+ let verification_route = server. and_then ( read) ;
35
+ run ( verification_route) . await ;
36
+ } ;
37
+ }
You can’t perform that action at this time.
0 commit comments