Skip to content

CfgStrip AST nodes marked with #[test] #4067

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 13, 2025
Merged

Conversation

powerboat9
Copy link
Collaborator

No description provided.

gcc/rust/ChangeLog:

	* expand/rust-cfg-strip.cc: Include "rust-macro-expand.h".
	(fails_cfg): Rename to...
	(CfgStrip::fails_cfg): ...here and handle test attributes.
	(fails_cfg_with_expand): Rename to...
	(CfgStrip::fails_cfg_with_expand): ...here and handle test
	attributes.
	* expand/rust-cfg-strip.h (struct ExpansionCfg): Forward
	declare.
	(CfgStrip::fails_cfg): New member function.
	(CfgStrip::fails_cfg_with_expand): Likewise.
	(CfgStrip::CfgStrip): Accept reference to ExpansionCfg.
	(CfgStrip::expansion_cfg): New member variable.
	* rust-session-manager.cc (Session::expansion): Pass
	ExpansionCfg instance to CfgStrip constructor.

gcc/testsuite/ChangeLog:

	* rust/compile/cfg-test.rs: New test.

Signed-off-by: Owen Avery <[email protected]>
Copy link
Member

@P-E-P P-E-P left a comment

Choose a reason for hiding this comment

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

I was under the impression that #[test] did not remove the function because we usually put them in a cfg(test) module, turns out I was wrong. LGTM

@P-E-P P-E-P added this pull request to the merge queue Aug 13, 2025
Merged via the queue into Rust-GCC:master with commit d18952a Aug 13, 2025
13 checks passed
@powerboat9 powerboat9 deleted the handle-test branch August 13, 2025 16:59
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.

2 participants