Skip to content

Support qualified trait item call expression#2097

Merged
philberty merged 6 commits into
masterfrom
phil/trait-call-expr
Apr 5, 2023
Merged

Support qualified trait item call expression#2097
philberty merged 6 commits into
masterfrom
phil/trait-call-expr

Conversation

@philberty

Copy link
Copy Markdown
Member

Fixes #2070

Calling PathProbeImplTrait resolves directly to the trait bound in question
to stop resolving to potentially multiple implementations of that bound

gcc/rust/ChangeLog:

	* backend/rust-compile-expr.cc (CompileExpr::resolve_method_address):
	call path probe impl trait

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/ChangeLog:

	* backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): call destructure

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/ChangeLog:

	* backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): remove unused

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/ChangeLog:

	* backend/rust-compile-base.cc (HIRCompileBase::resolve_method_address): moved here
	* backend/rust-compile-base.h: refactored prototype
	* backend/rust-compile-expr.cc (CompileExpr::resolve_method_address): refactor
	* backend/rust-compile-expr.h: likewise

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
It results in a recursive generic Param cycle.

gcc/rust/ChangeLog:

	* typecheck/rust-hir-path-probe.cc: dont subst with a dynamic object

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Fixes #2070

gcc/rust/ChangeLog:

	* backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile):
	reuse resolve_method_address to monomorphize the call if required
	* typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_segments):
	allow matching against unimplemented trait item bounds

gcc/testsuite/ChangeLog:

	* rust/compile/issue-2070.rs: New test.

Signed-off-by: Philip Herron <herron.philip@googlemail.com>

@CohenArthur CohenArthur left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@philberty philberty added this pull request to the merge queue Apr 5, 2023
Merged via the queue into master with commit 92b1370 Apr 5, 2023
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 CallExpr to trait item

2 participants