File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed
compiler/rustc_middle/src/ty
src/test/ui/closures/2229_closure_analysis/migrations Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -816,6 +816,15 @@ impl<'tcx> ty::TyS<'tcx> {
816816 [ component_ty] => component_ty,
817817 _ => self ,
818818 } ;
819+
820+ // FIXME: We should be canonicalizing, or else moving this to a method of inference
821+ // context, or *something* like that, but for now just avoid passing inference
822+ // variables to queries that can't cope with them. Instead, conservatively
823+ // return "true" (may change drop order).
824+ if query_ty. needs_infer ( ) {
825+ return true ;
826+ }
827+
819828 // This doesn't depend on regions, so try to minimize distinct
820829 // query keys used.
821830 let erased = tcx. normalize_erasing_regions ( param_env, query_ty) ;
Original file line number Diff line number Diff line change 1+ // edition:2018
2+ // check-pass
3+
4+ #![ warn( rust_2021_compatibility) ]
5+
6+ use std:: future:: Future ;
7+
8+ struct Runtime ;
9+
10+ impl Runtime {
11+ pub fn block_on < F : Future > ( & self , _future : F ) -> F :: Output {
12+ unimplemented ! ( )
13+ }
14+ }
15+
16+ pub fn http < F , Fut > ( _func : F )
17+ where
18+ F : Fn ( ) -> Fut ,
19+ Fut : Future < Output = ( ) > ,
20+ {
21+ let rt = Runtime { } ;
22+ let srv = rt. block_on ( async move { serve ( move || async move { unimplemented ! ( ) } ) } ) ;
23+ let _ = || rt. block_on ( async { srv } ) ;
24+ }
25+
26+ pub struct Server < S > {
27+ _marker : std:: marker:: PhantomData < S > ,
28+ }
29+
30+ pub fn serve < S > ( _new_service : S ) -> Server < S > {
31+ unimplemented ! ( )
32+ }
33+
34+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments