You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add a check against multiple only- directives in the same line #123730
which based on #123185 (comment) appears like it didn't run on just x64.
Assuming I'm right that this is what happened (if not, please close this) then it would be nice for the same helpful checker that tells me I did it wrong when I write linux-only to also tell me that I can't put multiple only checks on the same line.
We are able to detect unknown directives on their own, because we just have a non-exhaustive list of known directives and match against that. I suppose we could just try a match against the same known directive list for only-* comments to point out that you cannot chain directives in the same line? Although if we're doing it for only-* comments, what about other directives? It's a bit tricky because IIRC some directives allow comments, other directives don't accept comments...?
It is reasonable, the problem is that we have a lot of pre-existing directives that don't take this form (and we'd have to do another massive migration pass). I'm also not sure what ui_test does about this.
This would've been a less surprising directive grammar from the beginning, but of course hindsight is 20/20. I'm not sure it's worth the churn to change the grammar now.
Without changing the syntax, we could probably still error out if the sentence right after the directive is a well known directive. That way we should be able to catch @scottmcm mistake without massive change.
Activity
jieyouxu commentedon Apr 10, 2024
The reason is that I believe compiletest directive parsing for
only-*assumes that the directive takes the formwhere anything following
only-<condition>is treated as an optional commentjieyouxu commentedon Apr 10, 2024
We are able to detect unknown directives on their own, because we just have a non-exhaustive list of known directives and match against that. I suppose we could just try a match against the same known directive list for
only-*comments to point out that you cannot chain directives in the same line? Although if we're doing it foronly-*comments, what about other directives? It's a bit tricky because IIRC some directives allow comments, other directives don't accept comments...?scottmcm commentedon Apr 10, 2024
Brainstorming: maybe it'd be reasonable to require that the comment be in parens
or
or something like that?
jieyouxu commentedon Apr 10, 2024
It is reasonable, the problem is that we have a lot of pre-existing directives that don't take this form (and we'd have to do another massive migration pass). I'm also not sure what
ui_testdoes about this.jieyouxu commentedon Apr 10, 2024
This would've been a less surprising directive grammar from the beginning, but of course hindsight is 20/20. I'm not sure it's worth the churn to change the grammar now.
What we can do now without churn, however, is to explicitly document that directives are intended to be one-per-line in the dev guide (rust-lang/rustc-dev-guide#1962).
Urgau commentedon Apr 10, 2024
Without changing the syntax, we could probably still error out if the sentence right after the directive is a well known directive. That way we should be able to catch
@scottmcmmistake without massive change.Rollup merge of rust-lang#123753 - Urgau:compiletest-trailing-directi…
Rollup merge of rust-lang#123753 - Urgau:compiletest-trailing-directi…
Unrolled build for rust-lang#123753
workingjubilee commentedon Apr 27, 2024
This was done.