Skip to content

Conversation

0xllx0
Copy link

@0xllx0 0xllx0 commented Sep 12, 2025

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.

Note that you can skip the above if you are just opening a WIP PR in
order to get feedback.

Converts an assert into an early return during AST parsing.

Resolves: #4145

@@ -0,0 +1,8 @@
struct S {
Copy link
Author

Choose a reason for hiding this comment

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

Not sure on the exact decorators needed here, or if this test should go into the xfail directory. The test is expected to fail compilation, just with an error message instead of an ICE.

Copy link
Collaborator

Choose a reason for hiding this comment

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

grep for dg-error in the testsuite directory -- that should give you some nice examples for expecting error messages

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.

one tiny nitpick but the changes are really good, thank you for the work!

@0xllx0 0xllx0 force-pushed the fix/issue-4145 branch 2 times, most recently from 0e7b692 to 98c8cc2 Compare September 18, 2025 16:22
Converts an assert into an early return during AST parsing.

Resolves: Rust-GCC#4145

gcc/rust/ChangeLog:

	* ast/rust-ast.cc (Module::process_file_path): empty module early return

Signed-off-by: Elle Rhumsaa <[email protected]>
gcc/testsuite/ChangeLog:

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

Signed-off-by: Elle Rhumsaa <[email protected]>
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.

ICE in process_file_path, at rust/ast/rust-ast.cc:3386 , path name attr == mod name
4 participants