Skip to content

rust: Explicitly instantiate FFIVec<Piece> template#4446

Open
hriztam wants to merge 2 commits intoRust-GCC:masterfrom
hriztam:fix/clang-warning
Open

rust: Explicitly instantiate FFIVec<Piece> template#4446
hriztam wants to merge 2 commits intoRust-GCC:masterfrom
hriztam:fix/clang-warning

Conversation

@hriztam
Copy link

@hriztam hriztam commented Feb 24, 2026

Address #4441

rust: Explicitly instantiate FFIVec for C-linkage

Clang warns about returning an incomplete templated type from extern "C"
functions. Explicitly instantiating FFIVec before the declarations
makes the type complete at the declaration site and silences the warning
without changing behavior.

Signed-off-by: Hritam Shrivastava hritamstark05@gmail.com

@powerboat9
Copy link
Collaborator

It looks like you need to add a change log to your commit. Check out the change log section of https://gcc.gnu.org/contribute.html#patches (be discerning about the other sections, since the rust front end mostly uses github instead of email to coordinate patches)

@hriztam
Copy link
Author

hriztam commented Feb 26, 2026

hey @powerboat9 , I have added the changelog but still github check is not passing, can you please tell me what i'm doing wrong?

@powerboat9
Copy link
Collaborator

Oh, you're supposed to include the change log entry in your commit message, the ChangeLog file is automatically generated from that.

gcc/rust/ChangeLog:
2026-02-26  Hritam Shrivastava  <hritamstark05@gmail.com>

	* ast/rust-fmt.h: Explicitly instantiate FFIVec<Piece>.

Signed-off-by: Hritam Shrivastava <hritamstark05@gmail.com>
@powerboat9
Copy link
Collaborator

Could you add a comment about this being required to stop a clang warning?

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.

I think the fix is good, but your commits need to be squashed together in one commit. You also don't need to repeat your email address multiple times, just once at the end for the Signed-off-by line. Take a look at how other commits are formatted in our logs

std::make_shared<decltype (data)::element_type> (std::move (str),
std::move (pieces)))
std::make_shared<decltype (data)::element_type> (std::move (str),
std::move (pieces)))
Copy link
Member

Choose a reason for hiding this comment

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

This change is probably what makes the clang-format check fails, and is unneeded - please remove it :)

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.

3 participants