You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR aims to deduplicate the code the responsible for lowering the RHS of associated const bindings (found at bounds.rs and mod.rs) by creating a helper function lower_assoc_const_binding_rhs.
rustbot
added
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Apr 12, 2026
Nit: check_assoc_const_binding_type is called as bounds::check_assoc_const_binding_type at the mod.rs call site but as just check_assoc_const_binding_type (direct) at the bounds.rs call site — the helper normalises this to always call it as a method on self, which is correct, but worth verifying the two sites were always semantically equivalent (the FIXME comment in the old mod.rs code hints this was previously uncertain).
As far as I know, the FIXME in the old mod.rs was about code duplication in lowering the RHS type and not about the equivalence of the two call sites. Even then, the two call sites are semantically equivalent so no worries there. Thank you for the feedback though!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
S-waiting-on-reviewStatus: Awaiting review from the assignee but also interested parties.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
4 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR aims to deduplicate the code the responsible for lowering the RHS of associated const bindings (found at
bounds.rsandmod.rs) by creating a helper functionlower_assoc_const_binding_rhs.Related: #150621
Helper function code: