2023-05-11 11:43:09 +00:00
|
|
|
//@ run-rustfix
|
2024-11-29 03:28:02 +00:00
|
|
|
#![expect(incomplete_features)]
|
2023-05-11 11:43:09 +00:00
|
|
|
#![feature(explicit_tail_calls)]
|
|
|
|
|
|
|
|
fn a() {
|
|
|
|
become (|| ())();
|
|
|
|
//~^ ERROR: tail calling closures directly is not allowed
|
|
|
|
}
|
|
|
|
|
|
|
|
fn aa((): ()) {
|
|
|
|
become (|()| ())(());
|
|
|
|
//~^ ERROR: tail calling closures directly is not allowed
|
|
|
|
}
|
|
|
|
|
|
|
|
fn aaa((): (), _: i32) {
|
|
|
|
become (|(), _| ())((), 1);
|
|
|
|
//~^ ERROR: tail calling closures directly is not allowed
|
|
|
|
}
|
|
|
|
|
|
|
|
fn v((): (), ((), ()): ((), ())) -> (((), ()), ()) {
|
|
|
|
let f = |(), ((), ())| (((), ()), ());
|
|
|
|
become f((), ((), ()));
|
|
|
|
//~^ ERROR: tail calling closures directly is not allowed
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
a();
|
|
|
|
aa(());
|
|
|
|
aaa((), 1);
|
|
|
|
v((), ((), ()));
|
|
|
|
}
|