Landing: 3bbb6932842f

Project / Subsystem

gcc / gccrs

Date

2026-09-10

Author

Philip Herron

Commit

3bbb6932842f1126c9e1ef5fd9e3e4e6188d3dde

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
gccrs
patch_id
—
commit_hash
3bbb6932842f1126c9e1ef5fd9e3e4e6188d3dde
source_type
github
headline
Optimize const function resolution in gccrs
tldr
GCC Rust's type query system now avoids resolving non-const functions in const contexts, improving performance.
author
Philip Herron
outcome
committed
performance_win
true
breaking_change
false
series_id
—
series_parts
[]
tags
  • • gccrs
  • • optimization
  • • const evaluation
discussion_id_link
—
bugzilla_pr
—
date
2026-09-10T00:00:00.000Z

Philip Herron refactored the query_type function in gccrs to only fully resolve const functions when operating within a constant evaluation context. Previously, the system could inadvertently query and resolve non-const functions during method resolution, leading to unnecessary work. This change optimizes the handling of constant expressions by preventing the full evaluation of unrelated non-constant code paths.