diff options
Diffstat (limited to 'tests/ui/type-alias-impl-trait/recursive-fn-tait.rs')
-rw-r--r-- | tests/ui/type-alias-impl-trait/recursive-fn-tait.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/type-alias-impl-trait/recursive-fn-tait.rs b/tests/ui/type-alias-impl-trait/recursive-fn-tait.rs new file mode 100644 index 000000000..3d1759097 --- /dev/null +++ b/tests/ui/type-alias-impl-trait/recursive-fn-tait.rs @@ -0,0 +1,17 @@ +// test for #113326 +#![feature(type_alias_impl_trait)] + +pub type Diff = impl Fn(usize) -> usize; + +pub fn lift() -> Diff { + |_: usize |loop {} +} + +pub fn add( + n: Diff, + m: Diff, +) -> Diff { + move |x: usize| m(n(x)) //~ ERROR: concrete type differs +} + +fn main() {} |