gccrs: Fix ICE in handle_inline_attribute_on_fndecl
I added a check to see if the attr_input_type was a TOKEN_TREE and added an error message if a LITERAL is passed to it.
Fixes #3658
gcc/rust/ChangeLog:
* backend/rust-compile-base.cc (HIRCompileBase::handle_inline_attribute_on_fndecl):
Handle LITERAL attribute input type.
gcc/testsuite/ChangeLog:
* rust/compile/issue-3658.rs: New test.
Thank you for making Rust GCC better!
If your PR fixes an issue, you can add "Fixes #issue_number" into this PR description and the git commit message. This way the issue will be automatically closed when your PR is merged. If your change addresses an issue but does not fully fix it please mark it as "Addresses #issue_number" in the git commit message.
Here is a checklist to help you with your PR.
- [x] GCC development requires copyright assignment or the Developer's Certificate of Origin sign-off, see https://gcc.gnu.org/contribute.html or https://gcc.gnu.org/dco.html
- [x] Read contributing guidlines
- [x]
make check-rustpasses locally - [x] Run
clang-format - [ ] Added any relevant test cases to
gcc/testsuite/rust/
Note that you can skip the above if you are just opening a WIP PR in order to get feedback.
*Please write a comment explaining your change. This is the message that will be part of the merge commit.
FTR, in the changelog, you're supposed to give extra info, not only the filename:
* backend/rust-compile-base.cc (HIRCompileBase::handle_inline_attribute_on_fndecl): Handle LITERAL attribute input type.
FTR, in the changelog, you're supposed to give extra info, not only the filename:
* backend/rust-compile-base.cc (HIRCompileBase::handle_inline_attribute_on_fndecl): Handle LITERAL attribute input type.
Just made the requested change.
You must also use full issue ref, not only #<number>. We need this because commits will be contributed to GCC, so a bare #3658 will be ambiguous and will probably cause issue with the various bug trackers involved.
Please use Rust-GCC/gccrs#3658 instead (will be rendered the same here : Rust-GCC/gccrs#3658)
(obviously, https://github.com/Rust-GCC/gccrs/actions/runs/14523528568/job/40749776631?pr=3754 didn't work as expected...)
(obviously, https://github.com/Rust-GCC/gccrs/actions/runs/14523528568/job/40749776631?pr=3754 didn't work as expected...)
would this be something I could fix in the CI so it fails properly ?
https://github.com/Rust-GCC/gccrs/pull/3754#issuecomment-2814723242 fixed :)
(obviously, https://github.com/Rust-GCC/gccrs/actions/runs/14523528568/job/40749776631?pr=3754 didn't work as expected...)
would this be something I could fix in the CI so it fails properly ?
probably yes :)
https://github.com/Rust-GCC/gccrs/pull/3754#issuecomment-2814856629 I'll try to send in a PR soon!!