-
Notifications
You must be signed in to change notification settings - Fork 13.8k
compiletest: Pass around DirectiveLine
instead of bare strings
#147170
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
Conversation
This isn't actually used for anything, and its presence complicates the migration to `DirectiveLine`.
Some changes occurred in src/tools/compiletest cc @jieyouxu |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
/// Split off from the main `parse_name_value_directive`, so that improvements | ||
/// to directive handling aren't held back by debuginfo test commands. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
fn parse_negative_name_directive(&self, line: &str, directive: &str) -> bool { | ||
line.starts_with("no-") && self.parse_name_directive(&line[3..], directive) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦
@bors r+ rollup |
Rollup of 11 pull requests Successful merges: - #146918 (add regression test) - #146980 (simplify setup_constraining_predicates, and note it is potentially cubic) - #147170 (compiletest: Pass around `DirectiveLine` instead of bare strings) - #147180 (add tests) - #147188 (Remove usage of `compiletest-use-stage0-libtest` from CI) - #147189 (Replace `rustc_span::Span` with a stripped down version for librustdoc's highlighter) - #147199 (remove outdated comment in (inner) `InferCtxt`) - #147200 (Fix autodiff empty ret regression) - #147209 (Remove `no-remap-src-base` from tests) - #147213 (Fix broken STD build for ESP-IDF) - #147217 (Don't create a top-level `true` directory when running UI tests) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #147170 - Zalathar:directive, r=jieyouxu compiletest: Pass around `DirectiveLine` instead of bare strings This is an incremental step towards being able to clean up and centralize compiletest directive parsing. My original plan was to add features to `DirectiveLine`, and then gradually migrate parsing code to use those features. However, that turned out to be impractical, because of how the existing directive parsers call each other. So instead this PR focuses on getting them to all take `DirectiveLine` instead of bare strings, to enable incremental work in the future. Because this is part of an ongoing cleanup, I've prioritised clean diffs over nice code, because much of this code is going to be modified again when `DirectiveLine` is more capable. r? jieyouxu
compiletest: Make `DirectiveLine` responsible for name/value splitting - Follow-up to rust-lang#147170. --- Now that all of the directive-parsing functions have access to a `DirectiveLine`, we can move all of the ad-hoc name/value splitting code into `DirectiveLine` itself, making directive parsing simpler and more consistent. The first commit is just moving code into a submodule, so the actual changes can be seen in the subsequent commits. r? jieyouxu
compiletest: Make `DirectiveLine` responsible for name/value splitting - Follow-up to rust-lang#147170. --- Now that all of the directive-parsing functions have access to a `DirectiveLine`, we can move all of the ad-hoc name/value splitting code into `DirectiveLine` itself, making directive parsing simpler and more consistent. The first commit is just moving code into a submodule, so the actual changes can be seen in the subsequent commits. r? jieyouxu
compiletest: Make `DirectiveLine` responsible for name/value splitting - Follow-up to rust-lang#147170. --- Now that all of the directive-parsing functions have access to a `DirectiveLine`, we can move all of the ad-hoc name/value splitting code into `DirectiveLine` itself, making directive parsing simpler and more consistent. The first commit is just moving code into a submodule, so the actual changes can be seen in the subsequent commits. r? jieyouxu
compiletest: Make `DirectiveLine` responsible for name/value splitting - Follow-up to rust-lang#147170. --- Now that all of the directive-parsing functions have access to a `DirectiveLine`, we can move all of the ad-hoc name/value splitting code into `DirectiveLine` itself, making directive parsing simpler and more consistent. The first commit is just moving code into a submodule, so the actual changes can be seen in the subsequent commits. r? jieyouxu
compiletest: Make `DirectiveLine` responsible for name/value splitting - Follow-up to rust-lang#147170. --- Now that all of the directive-parsing functions have access to a `DirectiveLine`, we can move all of the ad-hoc name/value splitting code into `DirectiveLine` itself, making directive parsing simpler and more consistent. The first commit is just moving code into a submodule, so the actual changes can be seen in the subsequent commits. r? jieyouxu
compiletest: Make `DirectiveLine` responsible for name/value splitting - Follow-up to rust-lang#147170. --- Now that all of the directive-parsing functions have access to a `DirectiveLine`, we can move all of the ad-hoc name/value splitting code into `DirectiveLine` itself, making directive parsing simpler and more consistent. The first commit is just moving code into a submodule, so the actual changes can be seen in the subsequent commits. r? jieyouxu
compiletest: Make `DirectiveLine` responsible for name/value splitting - Follow-up to rust-lang#147170. --- Now that all of the directive-parsing functions have access to a `DirectiveLine`, we can move all of the ad-hoc name/value splitting code into `DirectiveLine` itself, making directive parsing simpler and more consistent. The first commit is just moving code into a submodule, so the actual changes can be seen in the subsequent commits. r? jieyouxu
compiletest: Make `DirectiveLine` responsible for name/value splitting - Follow-up to rust-lang#147170. --- Now that all of the directive-parsing functions have access to a `DirectiveLine`, we can move all of the ad-hoc name/value splitting code into `DirectiveLine` itself, making directive parsing simpler and more consistent. The first commit is just moving code into a submodule, so the actual changes can be seen in the subsequent commits. r? jieyouxu
compiletest: Make `DirectiveLine` responsible for name/value splitting - Follow-up to rust-lang#147170. --- Now that all of the directive-parsing functions have access to a `DirectiveLine`, we can move all of the ad-hoc name/value splitting code into `DirectiveLine` itself, making directive parsing simpler and more consistent. The first commit is just moving code into a submodule, so the actual changes can be seen in the subsequent commits. r? jieyouxu
Rollup merge of #147288 - Zalathar:directive, r=jieyouxu compiletest: Make `DirectiveLine` responsible for name/value splitting - Follow-up to #147170. --- Now that all of the directive-parsing functions have access to a `DirectiveLine`, we can move all of the ad-hoc name/value splitting code into `DirectiveLine` itself, making directive parsing simpler and more consistent. The first commit is just moving code into a submodule, so the actual changes can be seen in the subsequent commits. r? jieyouxu
This is an incremental step towards being able to clean up and centralize compiletest directive parsing.
My original plan was to add features to
DirectiveLine
, and then gradually migrate parsing code to use those features. However, that turned out to be impractical, because of how the existing directive parsers call each other. So instead this PR focuses on getting them to all takeDirectiveLine
instead of bare strings, to enable incremental work in the future.Because this is part of an ongoing cleanup, I've prioritised clean diffs over nice code, because much of this code is going to be modified again when
DirectiveLine
is more capable.r? jieyouxu