Skip to content

Conversation

@Pasta-coder
Copy link
Contributor

This patch implements the make_qualified_call helper function as requested by the TODO in rust-derive-clone.cc. It refactors DeriveClone::clone_call to use this new helper, simplifying the construction of qualified paths for function calls.

Fixes #4393

gcc/rust/ChangeLog:

* ast/rust-derive-clone.cc (make_qualified_call): New helper function.
(DeriveClone::clone_call): Use make_qualified_call.

@Pasta-coder Pasta-coder force-pushed the refactor/derive-clone-helper branch 2 times, most recently from 1229281 to d7df9ae Compare January 16, 2026 18:05
@Pasta-coder Pasta-coder marked this pull request as draft January 18, 2026 05:29
@Pasta-coder Pasta-coder force-pushed the refactor/derive-clone-helper branch 3 times, most recently from 5631aa0 to 7128540 Compare January 18, 2026 09:29
@Pasta-coder
Copy link
Contributor Author

Pasta-coder commented Jan 18, 2026

@CohenArthur , i got it , thanks for the review .

i applied the requested changed .

@Pasta-coder Pasta-coder marked this pull request as ready for review January 18, 2026 10:37
Copy link
Member

@CohenArthur CohenArthur left a comment

Choose a reason for hiding this comment

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

Looks good thank you! Just a few fixes and we can merge this

This patch implements the `qualified_call` helper method in the `Builder`
class. This logic was previously intended to be a local helper in
`DeriveClone`, but moving it to the `Builder` allows it to be reused
across the compiler for constructing qualified function calls.

It updates `DeriveClone::clone_call` to use this new `Builder` method,
simplifying the code and resolving the TODO.

Fixes Rust-GCC#4393

gcc/rust/ChangeLog:

	* ast/rust-ast-builder.h (Builder::qualified_call): New method declaration.
	* ast/rust-ast-builder.cc (Builder::qualified_call): Implement new method.
	* expand/rust-derive-clone.cc (DeriveClone::clone_call): Use builder.qualified_call.

Signed-off-by: Jayant Chauhan <0001jayant@gmail.com>
@Pasta-coder Pasta-coder force-pushed the refactor/derive-clone-helper branch from 7128540 to 515b5a8 Compare January 19, 2026 13:12
@Pasta-coder
Copy link
Contributor Author

@CohenArthur please review .

thnakyou .


// Not sure how to call it properly in the meantime...

auto path = std::unique_ptr<Expr> (
Copy link
Member

Choose a reason for hiding this comment

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

is this variable still used ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement the make_qualified_call helper function

3 participants