mirror of
https://github.com/rust-lang/rust.git
synced 2025-11-27 06:17:15 +00:00
30 lines
705 B
Rust
30 lines
705 B
Rust
#![feature(explicit_tail_calls, exclusive_wrapper, fn_traits, unboxed_closures)]
|
|
#![expect(incomplete_features)]
|
|
|
|
fn f() {}
|
|
|
|
fn g() {
|
|
become std::sync::Exclusive::new(f)() //~ error: tail calls can only be performed with function definitions or pointers
|
|
}
|
|
|
|
fn h() {
|
|
become (&mut &std::sync::Exclusive::new(f))() //~ error: tail calls can only be performed with function definitions or pointers
|
|
}
|
|
|
|
fn i() {
|
|
struct J;
|
|
|
|
impl FnOnce<()> for J {
|
|
type Output = ();
|
|
extern "rust-call" fn call_once(self, (): ()) -> Self::Output {}
|
|
}
|
|
|
|
become J(); //~ error: tail calls can only be performed with function definitions or pointers
|
|
}
|
|
|
|
fn main() {
|
|
g();
|
|
h();
|
|
i();
|
|
}
|