Landing: a99c41f91dde
Project / Subsystem
gcc / gccrs
Date
2026-06-24
Author
Lishin
Commit
a99c41f91ddedd84f8c3309a907a3d2a7f571ed9
Source
github
Perf win
No
Breaking
No
All attributes
- project
- gcc
- subsystem
- gccrs
- patch_id
- —
- commit_hash
- a99c41f91ddedd84f8c3309a907a3d2a7f571ed9
- source_type
- github
- headline
- Emit drops before explicit returns in GCC Rust
- tldr
- Ensures proper resource cleanup when explicit return statements are used in Rust code.
- author
- Lishin
- outcome
- committed
- performance_win
- false
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • gccrs
- • rust
- • drops
- • codegen
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-06-24T00:00:00.000Z
This commit ensures that destructors are correctly emitted for all active block scopes before an explicit return statement is executed in the GCC Rust compiler. If the explicit return has a value, it is saved before drops are performed. For unit returns with an expression, that expression is evaluated and its result handled before drops and the final unit return.