Open jieyouxu opened 6 months ago
I think an actual ui test has this problem?
Wait if I change it to //@ revisions: YES NO
which actually enables the compile-flags directives, this test still passes. What is this test actually checking then? Maybe it just doesn't actually need the compile-flags
?
Wait if I change it to //@ revisions: YES NO which actually enables the compile-flags directives, this test still passes. What is this test actually checking then? Maybe it just doesn't actually need the compile-flags?
Well, the test “needs” the compile-flags because it's checking that cfg ub_checks
is equivalent to cfg debug_assertions
for all values of debug_assertions
, i.e., yes
and no
(under the assumption that -Zub-checks
wasn't passed which holds). If you remove the flags the test covers fewer cases.
cc #123411 &
Yeah, I talked to Saethlin, makes sense. It's just compiletest silently failing here is awful 😆
I briefly looked at this, the easy fix is trivial, but the error handling is entirely not maintainable and involves propagating a poisoned: &mut bool
status bool through many callsites. The easy fix is like
I think the directive parsing is long past due for a rework. The error handling needs to not rely on passing a &mut bool
around everywhere.
compiletest expects that a name-value directive, like
//@ revisions: foo
, to have the colon:
https://github.com/rust-lang/rust/blob/b14d8b2ef20c64c1002e2c6c724025c3d0846b91/src/tools/compiletest/src/header.rs#L1137-L1146
If the name-value directive contains a known directive name like
revisions
but does not have the colon (i.e.//@ revisions foo
), then:revisions
parse_name_value_directive
expectsrevisions:
but only gotrevisions
, so parsing failsrevisions
directive namecompiletest should not silently fail here because it's very surprising and a pain to debug unless you know exactly what's wrong.