We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0ef36d2 commit 1ce7addCopy full SHA for 1ce7add
1 file changed
tests/ui/explicit-tail-calls/subtyping.rs
@@ -0,0 +1,28 @@
1
+// Check that signature comparison for tail calls allows subtyping.
2
+//
3
+//@ check-pass
4
+#![expect(incomplete_features)]
5
+#![feature(explicit_tail_calls)]
6
+
7
+fn f<'short>(
8
+ a: &'static (),
9
+ b: &'short (),
10
+ c: fn(&'static ()),
11
+ d: for<'a> fn(&'a ()),
12
+) -> (&'short (), fn(&'static ()), for<'a> fn(&'a ())) {
13
+ become g(b, a, d, c);
14
+}
15
16
+fn g<'short>(
17
+ // swapped short/static
18
+ a: &'short (),
19
+ b: &'static (),
20
+ // swapped binder/non binder
21
+ c: for<'a> fn(&'a ()),
22
+ d: fn(&'static ()),
23
+ // 'short=>'static; non binder=>binder
24
+) -> (&'static (), for<'a> fn(&'a ()), for<'a> fn(&'a ())) {
25
+ (b, c, c)
26
27
28
+fn main() {}
0 commit comments