compiletest: accept optional whitespace in version range directives#159499
compiletest: accept optional whitespace in version range directives#159499AayushMainali-Github wants to merge 2 commits into
Conversation
|
Some changes occurred in src/tools/compiletest cc @jieyouxu
|
|
Thanks for the pull request, and welcome! The Rust Project is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
Why was this reviewer chosen?The reviewer was selected based on:
|
|
Presuming my grep isn't broken, there don't seem to be many version range directives... I'm wondering if we can restrict to known versions of some kind in the syntax? Or maybe switch to e.g. Rust range syntax ( |
This should just be I almost feel like these should just be Ditto on For the LLVM versioning, we can probably re-use the rust/src/tools/compiletest/src/directives.rs Line 1288 in 234c31c However I'm not actually convinced the |
|
Thanks. Happy to change approach if preferred. Options I’m seeing:
Which direction should this PR take? @Mark-Simulacrum @jieyouxu |
extract_version_rangepreviously split only on"- ", so directives like//@ ignore-llvm-version: 23-99were treated as a single version (23) instead of a range. That silent misparse is what made #159331 necessary once LLVM trunk reached 24.This change treats a dash with a digit on both sides (after trimming surrounding whitespace) as a range separator, so forms with or without spaces around the dash all work. Non-numeric suffixes such as
1.2.3-rc1remain single versions.Fixes #159338.