Skip to content

Commit ac13f7a

Browse files
committed
Use cfg(false) in UI tests
1 parent 1ae993a commit ac13f7a

File tree

141 files changed

+470
-470
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+470
-470
lines changed

tests/pretty/ast-stmt-expr-attr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
fn main() {}
44

5-
#[cfg(FALSE)]
5+
#[cfg(false)]
66
fn syntax() {
77
let _ = #[attr] [];
88
let _ = #[attr] [0];

tests/pretty/enum-variant-vis.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
fn main() {}
66

7-
#[cfg(FALSE)]
7+
#[cfg(false)]
88
enum Foo { pub V, }

tests/pretty/if-attr.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ pp-exact
22

3-
#[cfg(FALSE)]
3+
#[cfg(false)]
44
fn simple_attr() {
55

66
#[attr]
@@ -10,21 +10,21 @@ fn simple_attr() {
1010
if true {}
1111
}
1212

13-
#[cfg(FALSE)]
13+
#[cfg(false)]
1414
fn if_else_chain() {
1515

1616
#[first_attr]
1717
if true {} else if false {} else {}
1818
}
1919

20-
#[cfg(FALSE)]
20+
#[cfg(false)]
2121
fn if_let() {
2222

2323
#[attr]
2424
if let Some(_) = Some(true) {}
2525
}
2626

27-
#[cfg(FALSE)]
27+
#[cfg(false)]
2828
fn let_attr_if() {
2929
let _ = #[attr] if let _ = 0 {};
3030
let _ = #[attr] if true {};

tests/pretty/nested-item-vis-defaultness.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
fn main() {}
66

7-
#[cfg(FALSE)]
7+
#[cfg(false)]
88
extern "C" {
99
static X: u8;
1010
type X;
@@ -14,7 +14,7 @@ extern "C" {
1414
pub fn foo();
1515
}
1616

17-
#[cfg(FALSE)]
17+
#[cfg(false)]
1818
trait T {
1919
const X: u8;
2020
type X;
@@ -30,7 +30,7 @@ trait T {
3030
pub default fn foo();
3131
}
3232

33-
#[cfg(FALSE)]
33+
#[cfg(false)]
3434
impl T for S {
3535
const X: u8;
3636
type X;
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
fn main() {
2-
#[cfg(FALSE)]
2+
#[cfg(false)]
33
<() as module>::mac!(); //~ ERROR macros cannot use qualified paths
44
}

tests/ui/async-await/feature-async-for-loop.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ fn f() {
1111
};
1212
}
1313

14-
#[cfg(FALSE)]
14+
#[cfg(false)]
1515
fn g() {
1616
let _ = async {
1717
for await _i in core::async_iter::from_iter(0..3) {

tests/ui/async-await/no-unsafe-async.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
struct S;
44

55
impl S {
6-
#[cfg(FALSE)]
6+
#[cfg(false)]
77
unsafe async fn g() {} //~ ERROR expected one of `extern` or `fn`, found keyword `async`
88
}
99

10-
#[cfg(FALSE)]
10+
#[cfg(false)]
1111
unsafe async fn f() {} //~ ERROR expected one of `extern` or `fn`, found keyword `async`
1212

1313
fn main() {}

tests/ui/attributes/z-crate-attr/cfg-false.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Ensure that `-Z crate-attr=cfg(FALSE)` can comment out the whole crate
2-
//@ compile-flags: --crate-type=lib -Zcrate-attr=cfg(FALSE)
1+
// Ensure that `-Z crate-attr=cfg(false)` can comment out the whole crate
2+
//@ compile-flags: --crate-type=lib -Zcrate-attr=cfg(false)
33
//@ check-pass
44

55
// NOTE: duplicate items are load-bearing

tests/ui/auto-traits/pre-cfg.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ check-pass
22

3-
#[cfg(FALSE)]
3+
#[cfg(false)]
44
auto trait Foo {}
55
//~^ WARN `auto` traits are unstable
66
//~| WARN unstable syntax can change at any point in the future, causing a hard error!
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// `#![no_std]` on a fully unconfigured crate is respected if it's placed before `cfg(FALSE)`.
1+
// `#![no_std]` on a fully unconfigured crate is respected if it's placed before `cfg(false)`.
22
// This crate has no such attribute, therefore this crate does link to libstd.
33

4-
#![cfg(FALSE)]
4+
#![cfg(false)]
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// `#![no_std]` on a fully unconfigured crate is respected if it's placed before `cfg(FALSE)`.
1+
// `#![no_std]` on a fully unconfigured crate is respected if it's placed before `cfg(false)`.
22
// Therefore this crate does link to libstd.
33

4-
#![cfg(FALSE)]
4+
#![cfg(false)]
55
#![no_std]
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
// `#![no_std]` on a fully unconfigured crate is respected if it's placed before `cfg(FALSE)`.
1+
// `#![no_std]` on a fully unconfigured crate is respected if it's placed before `cfg(false)`.
22
// Therefore this crate doesn't link to libstd.
33

44
//@ no-prefer-dynamic
55

66
#![no_std]
77
#![crate_type = "lib"]
8-
#![cfg(FALSE)]
8+
#![cfg(false)]

tests/ui/cfg/auxiliary/cfged_out.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
pub mod inner {
2-
#[cfg(FALSE)]
2+
#[cfg(false)]
33
pub fn uwu() {}
44

5-
#[cfg(FALSE)]
5+
#[cfg(false)]
66
pub mod doesnt_exist {
77
pub fn hello() {}
88
}

tests/ui/cfg/cfg-false-feature.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// Features above `cfg(FALSE)` are in effect in a fully unconfigured crate (issue #104633).
1+
// Features above `cfg(false)` are in effect in a fully unconfigured crate (issue #104633).
22

33
//@ check-pass
44
//@ compile-flags: --crate-type lib
55

66
#![feature(decl_macro)]
7-
#![cfg(FALSE)]
7+
#![cfg(false)]
88
#![feature(box_patterns)]
99

1010
macro mac() {} // OK

tests/ui/cfg/cfg-macros-notfoo.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// check that cfg correctly chooses between the macro impls (see also
44
// cfg-macros-foo.rs)
55

6-
#[cfg(FALSE)]
6+
#[cfg(false)]
77
#[macro_use]
88
mod foo {
99
macro_rules! bar {

tests/ui/cfg/cfg-match-arm.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ fn foo(f: Foo) {
1111
Foo::Bar => {},
1212
#[cfg(not(FALSE))]
1313
Foo::Baz => {},
14-
#[cfg(FALSE)]
14+
#[cfg(false)]
1515
Basdfwe => {}
1616
}
1717
}

tests/ui/cfg/cfg-stmt-recovery.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#[cfg_eval]
77
fn main() {
88
#[cfg_eval]
9-
let _ = #[cfg(FALSE)] 0;
9+
let _ = #[cfg(false)] 0;
1010
//~^ ERROR removing an expression is not supported in this position
1111
//~| ERROR expected expression, found `;`
1212
//~| ERROR removing an expression is not supported in this position

tests/ui/cfg/cfg-stmt-recovery.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
error: removing an expression is not supported in this position
22
--> $DIR/cfg-stmt-recovery.rs:9:13
33
|
4-
LL | let _ = #[cfg(FALSE)] 0;
4+
LL | let _ = #[cfg(false)] 0;
55
| ^^^^^^^^^^^^^
66

77
error: expected expression, found `;`
88
--> $DIR/cfg-stmt-recovery.rs:9:28
99
|
10-
LL | let _ = #[cfg(FALSE)] 0;
10+
LL | let _ = #[cfg(false)] 0;
1111
| ^ expected expression
1212

1313
error: removing an expression is not supported in this position
1414
--> $DIR/cfg-stmt-recovery.rs:9:13
1515
|
16-
LL | let _ = #[cfg(FALSE)] 0;
16+
LL | let _ = #[cfg(false)] 0;
1717
| ^^^^^^^^^^^^^
1818

1919
error: aborting due to 3 previous errors

tests/ui/cfg/cfg_stmt_expr.rs

+15-15
Original file line numberDiff line numberDiff line change
@@ -7,47 +7,47 @@
77

88
fn main() {
99
let a = 413;
10-
#[cfg(FALSE)]
10+
#[cfg(false)]
1111
let a = ();
1212
assert_eq!(a, 413);
1313

1414
let mut b = 612;
15-
#[cfg(FALSE)]
15+
#[cfg(false)]
1616
{
1717
b = 1111;
1818
}
1919
assert_eq!(b, 612);
2020

21-
#[cfg(FALSE)]
21+
#[cfg(false)]
2222
undefined_fn();
2323

24-
#[cfg(FALSE)]
24+
#[cfg(false)]
2525
undefined_macro!();
26-
#[cfg(FALSE)]
26+
#[cfg(false)]
2727
undefined_macro![];
28-
#[cfg(FALSE)]
28+
#[cfg(false)]
2929
undefined_macro!{};
3030

3131
// pretty printer bug...
32-
// #[cfg(FALSE)]
32+
// #[cfg(false)]
3333
// undefined_macro!{}
3434

35-
let () = (#[cfg(FALSE)] 341,); // Should this also work on parens?
36-
let t = (1, #[cfg(FALSE)] 3, 4);
35+
let () = (#[cfg(false)] 341,); // Should this also work on parens?
36+
let t = (1, #[cfg(false)] 3, 4);
3737
assert_eq!(t, (1, 4));
3838

3939
let f = |_: u32, _: u32| ();
40-
f(2, 1, #[cfg(FALSE)] 6);
40+
f(2, 1, #[cfg(false)] 6);
4141

42-
let _: u32 = a.clone(#[cfg(FALSE)] undefined);
42+
let _: u32 = a.clone(#[cfg(false)] undefined);
4343

44-
let _: [(); 0] = [#[cfg(FALSE)] 126];
45-
let t = [#[cfg(FALSE)] 1, 2, 6];
44+
let _: [(); 0] = [#[cfg(false)] 126];
45+
let t = [#[cfg(false)] 1, 2, 6];
4646
assert_eq!(t, [2, 6]);
4747

4848
{
4949
let r;
50-
#[cfg(FALSE)]
50+
#[cfg(false)]
5151
(r = 5);
5252
#[cfg(not(FALSE))]
5353
(r = 10);
@@ -75,7 +75,7 @@ fn main() {
7575
612
7676
});
7777

78-
assert_eq!((#[cfg(FALSE)] 1, #[cfg(not(FALSE))] 2), (2,));
78+
assert_eq!((#[cfg(false)] 1, #[cfg(not(FALSE))] 2), (2,));
7979
assert_eq!(n, 612);
8080

8181
// check that lints work

0 commit comments

Comments
 (0)