Skip to content

Commit 3371ceb

Browse files
committed
add a test
1 parent 223e885 commit 3371ceb

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

compiler/rustc_mir_build/src/check_tail_calls.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ impl<'tcx> TailCallCkVisitor<'_, 'tcx> {
168168
let cause = ObligationCause::misc(expr.span, self.caller_def_id);
169169

170170
// Erase safety, as it never affects ABI and is thus irrelevant for tail calls
171-
// TODO: check if there is a test for this
172171
let caller_sig = caller_sig.set_safety(Safety::Safe);
173172
let callee_sig = callee_sig.set_safety(Safety::Safe);
174173

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Checks that you can tail call functions with different unsafety
2+
//
3+
//@ check-pass
4+
#![feature(explicit_tail_calls)]
5+
#![expect(incomplete_features)]
6+
7+
fn a() {
8+
unsafe {
9+
become b();
10+
}
11+
}
12+
13+
unsafe fn b() {
14+
become c();
15+
}
16+
17+
fn c() {}
18+
19+
fn main() {}

0 commit comments

Comments
 (0)