Skip to content

rust: Explicitly instantiate FFIVec<Piece> template#4446

Merged
powerboat9 merged 1 commit intoRust-GCC:masterfrom
hriztam:fix/clang-warning
Mar 21, 2026
Merged

rust: Explicitly instantiate FFIVec<Piece> template#4446
powerboat9 merged 1 commit intoRust-GCC:masterfrom
hriztam:fix/clang-warning

Conversation

@hriztam
Copy link
Copy Markdown
Contributor

@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
Copy Markdown
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
Copy Markdown
Contributor 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
Copy Markdown
Collaborator

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

@powerboat9
Copy link
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
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

Comment thread gcc/rust/ast/rust-fmt.h Outdated
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
Copy Markdown
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 :)

@hriztam hriztam force-pushed the fix/clang-warning branch from 1a8dcb0 to 174e05f Compare March 17, 2026 12:50
@hriztam
Copy link
Copy Markdown
Contributor Author

hriztam commented Mar 17, 2026

hello @CohenArthur , apologies for not being active for this long, I was busy with some personal issues but now I'm well and I wanna contribute to rust-gcc with the best of my abilities, I have squished the commits like you asked, let me know if you need any changes

@powerboat9
Copy link
Copy Markdown
Collaborator

Looks like you've just got to adjust the code formatting and remove the extra

2026-02-26  Hritam Shrivastava

from the commit message.

gcc/rust/ChangeLog:

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

Signed-off-by: Hritam Shrivastava <hritamstark05@gmail.com>
@hriztam hriztam force-pushed the fix/clang-warning branch from 174e05f to 7a9c40c Compare March 21, 2026 12:15
@hriztam
Copy link
Copy Markdown
Contributor Author

hriztam commented Mar 21, 2026

done @powerboat9

@powerboat9 powerboat9 added this pull request to the merge queue Mar 21, 2026
Merged via the queue into Rust-GCC:master with commit 29f1bf1 Mar 21, 2026
12 checks passed
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