Skip to content

Commit 1faa95d

Browse files
committed
Update UI tests which relied on old behavior of constructing a default error handler every time
`early_warn` is called Skip `colored-session-opt-error.rs` on Windows hosts This is very cursed as to why it fails on Windows CI specifically: - The test emits a *warning*. - *Warnings*, and only warnings *specifically*, have a different 256-color between Windows and non-Windows hosts (other levels `set_intense(true)` unconditionally): https://github.com/rust-lang/rust/blob/e69c7306e2be08939d95f14229e3f96566fb206c/compiler/rustc_errors/src/lib.rs#L1792-L1794 Therefore, I added `// ignore-windows` test header to skip this test on Windows (it's sufficient to test color is enabled on at least one non-Windows host).
1 parent 53245a1 commit 1faa95d

8 files changed

+8
-7
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
// compile-flags: --cfg a(b=c)
1+
// compile-flags: --error-format=human --cfg a(b=c)
22
// error-pattern: invalid `--cfg` argument: `a(b=c)` (expected `key` or `key="value"`, ensure escaping is appropriate for your shell, try 'key="value"' or key=\"value\")
33
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
// compile-flags: --cfg a{b}
1+
// compile-flags: --error-format=human --cfg a{b}
22
// error-pattern: invalid `--cfg` argument: `a{b}` (expected `key` or `key="value"`)
33
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
// compile-flags: --cfg a(b)
1+
// compile-flags: --error-format=human --cfg a(b)
22
// error-pattern: invalid `--cfg` argument: `a(b)` (expected `key` or `key="value"`)
33
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
// compile-flags: --cfg a{
1+
// compile-flags: --error-format=human --cfg a{
22
// error-pattern: invalid `--cfg` argument: `a{` (expected `key` or `key="value"`)
33
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
// compile-flags: --cfg )
1+
// compile-flags: --error-format=human --cfg )
22
// error-pattern: invalid `--cfg` argument: `)` (expected `key` or `key="value"`)
33
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// Test for missing quotes around value, issue #66450.
2-
// compile-flags: --cfg key=value
2+
// compile-flags: --error-format=human --cfg key=value
33
// error-pattern: invalid `--cfg` argument: `key=value` (expected `key` or `key="value"`, ensure escaping is appropriate for your shell, try 'key="value"' or key=\"value\")
44
fn main() {}

tests/ui/conditional-compilation/cfg-empty-codemap.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Tests that empty source_maps don't ICE (#23301)
22

3-
// compile-flags: --cfg ""
3+
// compile-flags: --error-format=human --cfg ""
44

55
// error-pattern: invalid `--cfg` argument: `""` (expected `key` or `key="value"`)
66

Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
// check-pass
2+
// ignore-windows
23
// compile-flags: -Cremark=foo --error-format=human --color always
34
fn main() {}

0 commit comments

Comments
 (0)