Skip to content

Commit f288760

Browse files
bonziniBennoLossin
authored andcommitted
fix usage of cfg_attr
Elide the functions completely when miri or NO_UI_TESTS are enabled. Extracted from a patch by Benno Lossin. Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 3fb9294 commit f288760

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/ui.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#[cfg_attr(not(any(miri, NO_UI_TESTS)), test)]
1+
#[cfg(not(any(miri, NO_UI_TESTS)))]
2+
#[test]
23
fn compile_fail() {
34
let test_cases = trybuild::TestCases::new();
45
test_cases.compile_fail("tests/ui/compile-fail/pinned_drop/*.rs");
@@ -7,7 +8,8 @@ fn compile_fail() {
78
test_cases.compile_fail("tests/ui/compile-fail/zeroable/*.rs");
89
}
910

10-
#[cfg_attr(not(any(miri, NO_UI_TESTS)), test)]
11+
#[cfg(not(any(miri, NO_UI_TESTS)))]
12+
#[test]
1113
fn expand() {
1214
macrotest::expand("tests/ui/expand/*.rs");
1315
}

0 commit comments

Comments
 (0)