File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
tests/ui/type-alias-impl-trait Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ // ICE Failed to normalize closure with TAIT
2+ // issue: rust-lang/rust#109020
3+ //@ check-pass
4+
5+ #![ feature( type_alias_impl_trait) ]
6+
7+ use std:: marker:: PhantomData ;
8+
9+ type WithEmplacableForFn < ' a > = impl EmplacableFn + ' a ;
10+
11+ fn with_emplacable_for < ' a , F , R > ( mut f : F ) -> R
12+ where
13+ F : for < ' b > FnMut ( Emplacable < WithEmplacableForFn < ' b > > ) -> R ,
14+ {
15+ fn with_emplacable_for_inner < ' a , R > (
16+ _: & ' a ( ) ,
17+ _: & mut dyn FnMut ( Emplacable < WithEmplacableForFn < ' a > > ) -> R ,
18+ ) -> R {
19+ fn _constrain ( _: & mut ( ) ) -> WithEmplacableForFn < ' _ > {
20+ ( )
21+ }
22+ loop { }
23+ }
24+
25+ with_emplacable_for_inner ( & ( ) , & mut f)
26+ }
27+
28+ trait EmplacableFn { }
29+
30+ impl EmplacableFn for ( ) { }
31+
32+ struct Emplacable < F >
33+ where
34+ F : EmplacableFn ,
35+ {
36+ phantom : PhantomData < F > ,
37+ }
38+
39+ fn main ( ) {
40+ with_emplacable_for ( |_| { } ) ;
41+ }
You can’t perform that action at this time.
0 commit comments