Landing: 93442d52b78f

Project / Subsystem

gcc / gccrs

Date

2026-06-24

Author

Lishin

Commit

93442d52b78f281a1a9764e86c387662de04c4d8

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
gccrs
patch_id
—
commit_hash
93442d52b78f281a1a9764e86c387662de04c4d8
source_type
github
headline
gccrs: Evaluate non-unit tail expressions before drops
tldr
Ensures non-unit tail expressions are evaluated before local drops in Rust functions.
author
Lishin
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • gccrs
  • • rust
  • • backend
discussion_id_link
—
bugzilla_pr
—
date
2026-06-24T00:00:00.000Z

This change modifies the Rust compiler frontend to correctly evaluate non-unit tail expressions before any local variable drops occur within a function body. Previously, a non-unit tail call could execute after local drops, potentially leading to incorrect program state. The fix involves storing the result of the tail expression before emitting the drops and then returning the stored value, ensuring proper execution order.