Landing: 8b20ce82d7c7

Project / Subsystem

gcc / gccrs

Date

2026-06-19

Author

Lishin

Commit

8b20ce82d7c7113d5ca8c6d198c8ed674f4b51d4

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
gccrs
patch_id
—
commit_hash
8b20ce82d7c7113d5ca8c6d198c8ed674f4b51d4
source_type
github
headline
gccrs: Emit function-scope drops for unit tail expressions
tldr
GCC's Rust compiler now emits necessary drop calls for unit tail expressions.
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-06-19T00:00:00.000Z

GCC’s Rust compiler now correctly emits drop calls for unit tail expressions within functions. This ensures that any resources held by variables in scope are properly cleaned up before the function returns, particularly when the function’s last expression implicitly returns a unit type. This fix addresses a gap in resource management for such cases.