Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP typecheck issues with Try #3394

Closed
wants to merge 3 commits into from
Closed

WIP typecheck issues with Try #3394

wants to merge 3 commits into from

Conversation

philberty
Copy link
Member

When we pass generic types as the Self on traits they need to be handled via a special case on fntypes, ADT's and placeholders as the type params won't necessarily match up because of the implicit Self.

Fixes #3382

gcc/rust/ChangeLog:

* typecheck/rust-substitution-mapper.cc (SubstMapperInternal::visit): special case

gcc/testsuite/ChangeLog:

* rust/compile/nr2/exclude: nr2 cant handle this
* rust/compile/issue-3382.rs: New test.

When we pass generic types as the Self on traits they need to be handled
via a special case on fntypes, ADT's and placeholders as the type params
won't necessarily match up because of the implicit Self.

Fixes #3382

gcc/rust/ChangeLog:

	* typecheck/rust-substitution-mapper.cc (SubstMapperInternal::visit): special case

gcc/testsuite/ChangeLog:

	* rust/compile/nr2/exclude: nr2 cant handle this
	* rust/compile/issue-3382.rs: New test.

Signed-off-by: Philip Herron <[email protected]>
@philberty philberty force-pushed the phil/try-compatible branch from 35bb75f to a0e217b Compare January 31, 2025 17:10
@philberty philberty changed the title gccrs: fix bad generic substitution on trait impls WIP typecheck issues with Try Jan 31, 2025
@philberty
Copy link
Member Author

closing this down to open up sperate PR's for the fixes

@philberty philberty closed this Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Failed to resolve field substitution in generic impl of Try for Result<T, E>
1 participant