gccrs: Add new resolution mode CANONICAL/REFERNECE to type-check-type - #4840
Merged
Conversation
When handling where clause items such as:
fn check<P>()
where
P: Deref,
P::Target: Marker
What happens is the first 'P' used to get resolved to a reference hir-id
item which meant that adding the bound to this position had no effect what
needed to occur was bind it to the parent which meant i used name resolution
to reverse lookup as a hack. This new mode for canonical gives us that
parent in the first place so we can just add the bound directly now so no
need for name resolution here
Fixes #4829
gcc/rust/ChangeLog:
* typecheck/rust-hir-type-check-type.cc (TypeCheckType::Resolve): new mode
(TypeCheckType::visit): likewise
(ResolveWhereClauseItem::visit): remove nr usage
* typecheck/rust-hir-type-check-type.h: new mode
gcc/testsuite/ChangeLog:
* rust/compile/issue-4829-1.rs: New test.
* rust/compile/issue-4829-2.rs: New test.
Signed-off-by: Philip Herron <herron.philip@googlemail.com>
philberty
force-pushed
the
phil/where-clause
branch
from
September 3, 2026 10:23
2d7ebdf to
550b9b0
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When handling where clause items such as:
What happens is the first 'P' used to get resolved to a reference hir-id item which meant that adding the bound to this position had no effect what needed to occur was bind it to the parent which meant i used name resolution to reverse lookup as a hack. This new mode for canonical gives us that parent in the first place so we can just add the bound directly now so no need for name resolution here
Fixes #4829
gcc/rust/ChangeLog:
gcc/testsuite/ChangeLog: