Repository navigation
Add support for limiting which macros use clang fallback - #3513
Open
DanielEScherzer wants to merge 1 commit into
Open
DanielEScherzer wants to merge 1 commit into
DanielEScherzer wants to merge 1 commit into
Conversation
DanielEScherzer
force-pushed
the
limit-clang-macro-fallback
branch
from
October 9, 2026 20:50
80a4322 to
8999ece
Compare
Contributor
Author
|
Clippy errors are unrelated and I sent #3514 to fix them |
This comment has been minimized.
This comment has been minimized.
emilio
reviewed
Oct 13, 2026
| #[arg(long)] | ||
| clang_macro_fallback: bool, | ||
| /// Enable fallback for clang macro parsing for macros matching REGEX. | ||
| #[arg(long, value_name = "REGEX")] |
Contributor
There was a problem hiding this comment.
I guess it's not easy to make the non-value version work with .*? That's a bit unfortunate. I guess #3518 bitrotted this a bit but we should probably not auto-enable macro fallback there.
DanielEScherzer
force-pushed
the
limit-clang-macro-fallback
branch
from
October 19, 2026 22:15
8999ece to
0251317
Compare
Collaborator
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Contributor
Author
|
Rebased and also updated the logic from #3518 to use a regex set too |
Change the `Builder::clang_macro_fallback()` method and the `--clang-macro-fallback` command line option to update a `RegexSet` rather than using a boolean flag. This is a breaking change - both the method and the CLI option now require an argument. To match the previous behavior of using the fallback for all macros, use `.*` as the pattern. Apply the same changes to `Builder::macro_const_use_ctypes()` and the `--macro-const-use-ctypes` command line option. Closes rust-lang#3511
DanielEScherzer
force-pushed
the
limit-clang-macro-fallback
branch
from
October 19, 2026 22:16
0251317 to
99c0a52
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change the
Builder::clang_macro_fallback()method and the--clang-macro-fallbackcommand line option to update aRegexSetrather than using a boolean flag. This is a breaking change - both the method and the CLI option now require an argument. To match the previous behavior of using the fallback for all macros, use.*as the pattern.Closes #3511