Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1092373

Browse files
committedMar 16, 2025
Make GCC backend explicitly fail on tail call attempts
1 parent 801365c commit 1092373

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎compiler/rustc_codegen_gcc/src/builder.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1685,10 +1685,12 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
16851685
fn apply_attrs_to_cleanup_callsite(&mut self, _llret: RValue<'gcc>) {
16861686
// FIXME(bjorn3): implement
16871687
}
1688-
1688+
16891689
fn set_tail_call(&mut self, _call_inst: RValue<'gcc>) {
1690-
// TODO: Implement proper tail call optimization for GCC backend
1691-
// For now, this is a no-op to make compilation work
1690+
// Explicitly fail when this method is called
1691+
bug!(
1692+
"Guaranteed tail calls with the 'become' keyword are not implemented in the GCC backend"
1693+
);
16921694
}
16931695

16941696
fn set_span(&mut self, _span: Span) {}

0 commit comments

Comments
 (0)
Failed to load comments.