Repository navigation
Conversation
|
Some changes occurred in src/tools/compiletest cc @jieyouxu |
|
These refactorings aren't the most exciting, I wanted to do more but ran out of time last Sunday as I had to dip. One "large" thing I want to do eventually is to avoid reparsing directives. AFAICT for the UI test suite, we always parse directives twice, first when "constructing" the test ( For that I could be mistaken but for the rustdoc-html test suite it seemed like we parse directives 4 times. Needs investigation. Once we only parse directives once, it should be easier to make errors in |
5f8f169 to
2c1918d
Compare
This comment has been minimized.
This comment has been minimized.
|
I've addressed your comments and implemented some more checks (as alluded to in my Zulip PM):
>>> Changes since your last review <<<. @rustbot review |
b71bb77 to
edb7c1f
Compare
This comment has been minimized.
This comment has been minimized.
3bf4f7d to
f174681
Compare
This comment has been minimized.
This comment has been minimized.
And stop accepting empty directive names & empty values (after the `:`).
…vision conditions
f174681 to
f18a370
Compare
|
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. |
|
Reverted the "directive name needs to be alphanumerical ∪ { @rustbot review |
| if rev.is_empty() || rev.contains(|char| !is_identifier_char(char)) { | ||
| return error(ErrorKind::InvalidRevisionName { revision: rev }); | ||
| } |
There was a problem hiding this comment.
Hm, right now we are rejecting usage of invalid directive names (i.e. alphanumeric _, -} but we weren't rejecting declarations of invalid direction names right? So I think parse_and_update_revisions also needs to reject symmetrically, otherwise we'd end up with
//@ revisions: a$b
//@[a$b] oops-cant-use-it
There was a problem hiding this comment.
Yep :) I also realized this but shrugged it off as I was thinking about doing that in a follow-up PR but it's probably better to do it at once. That would then also fix #123765 (which is about both the revision directive and [ revision conditions ]).
| fn is_identifier_char(char: char) -> bool { | ||
| char == '-' || char == '_' || char.is_ascii_alphanumeric() | ||
| } |
There was a problem hiding this comment.
Nit: bit pedantic, but maybe is_valid_revision_name_char, since e.g. I don't think foo-bar is a valid identifier in Rust
View all comments
See individual commits for details. Follow-up to #165576 and #165483.
r? jieyouxu
(No LLM was or will be used by me during the entire creation process of this PR)