Landing: 0a0bbb5e0748

Project / Subsystem

gcc / gccrs

Date

2026-07-02

Author

Lishin

Commit

0a0bbb5e07487353b13f3787143f715839124675

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
gccrs
patch_id
—
commit_hash
0a0bbb5e07487353b13f3787143f715839124675
source_type
github
headline
gccrs: Emit block scope drops through TRY_FINALLY_EXPR
tldr
GCC's Rust compiler now emits block scope drops using TRY_FINALLY_EXPR for proper cleanup.
author
Lishin
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • gccrs
  • • cleanup
  • • compiler
discussion_id_link
—
bugzilla_pr
—
date
2026-07-02T00:00:00.000Z

GCC’s Rust compiler has been updated to emit block-scope Drop calls through TRY_FINALLY_EXPR. This change ensures that destructors are correctly invoked when blocks are exited, even if cleanup code is involved. A new function, Context::pop_block_with_cleanup, is introduced to facilitate this, allowing cleanup logic to be passed as part of the block-popping operation.