Skip to content

Commit 0a56d80

Browse files
committed
Add license header to the new tests
Beta still requires them.
1 parent 520ec9b commit 0a56d80

7 files changed

+69
-9
lines changed

src/test/ui/cfg-arg-invalid-1.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
111
// compile-flags: --cfg a(b=c)
212
// error-pattern: invalid `--cfg` argument: `a(b=c)` (expected `key` or `key="value"`)
313
fn main() {}

src/test/ui/cfg-arg-invalid-2.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
111
// compile-flags: --cfg a{b}
212
// error-pattern: invalid `--cfg` argument: `a{b}` (expected `key` or `key="value"`)
313
fn main() {}

src/test/ui/cfg-arg-invalid-3.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
111
// compile-flags: --cfg a::b
212
// error-pattern: invalid `--cfg` argument: `a::b` (argument key must be an identifier)
313
fn main() {}

src/test/ui/cfg-arg-invalid-4.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
111
// compile-flags: --cfg a(b)
212
// error-pattern: invalid `--cfg` argument: `a(b)` (expected `key` or `key="value"`)
313
fn main() {}

src/test/ui/cfg-arg-invalid-5.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
111
// compile-flags: --cfg a=10
212
// error-pattern: invalid `--cfg` argument: `a=10` (argument value must be a string)
313
fn main() {}

src/test/ui/cfg-attr-syntax-validation.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
111
#[cfg] //~ ERROR `cfg` is not followed by parentheses
212
struct S1;
313

src/test/ui/cfg-attr-syntax-validation.stderr

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
11
error: `cfg` is not followed by parentheses
2-
--> $DIR/cfg-attr-syntax-validation.rs:1:1
2+
--> $DIR/cfg-attr-syntax-validation.rs:11:1
33
|
44
LL | #[cfg] //~ ERROR `cfg` is not followed by parentheses
55
| ^^^^^^ help: expected syntax is: `cfg(/* predicate */)`
66

77
error: `cfg` is not followed by parentheses
8-
--> $DIR/cfg-attr-syntax-validation.rs:4:1
8+
--> $DIR/cfg-attr-syntax-validation.rs:14:1
99
|
1010
LL | #[cfg = 10] //~ ERROR `cfg` is not followed by parentheses
1111
| ^^^^^^^^^^^ help: expected syntax is: `cfg(/* predicate */)`
1212

1313
error: `cfg` predicate is not specified
14-
--> $DIR/cfg-attr-syntax-validation.rs:7:1
14+
--> $DIR/cfg-attr-syntax-validation.rs:17:1
1515
|
1616
LL | #[cfg()] //~ ERROR `cfg` predicate is not specified
1717
| ^^^^^^^^
1818

1919
error: multiple `cfg` predicates are specified
20-
--> $DIR/cfg-attr-syntax-validation.rs:10:10
20+
--> $DIR/cfg-attr-syntax-validation.rs:20:10
2121
|
2222
LL | #[cfg(a, b)] //~ ERROR multiple `cfg` predicates are specified
2323
| ^
2424

2525
error: `cfg` predicate key cannot be a literal
26-
--> $DIR/cfg-attr-syntax-validation.rs:13:7
26+
--> $DIR/cfg-attr-syntax-validation.rs:23:7
2727
|
2828
LL | #[cfg("str")] //~ ERROR `cfg` predicate key cannot be a literal
2929
| ^^^^^
3030

3131
error: `cfg` predicate key must be an identifier
32-
--> $DIR/cfg-attr-syntax-validation.rs:16:7
32+
--> $DIR/cfg-attr-syntax-validation.rs:26:7
3333
|
3434
LL | #[cfg(a::b)] //~ ERROR `cfg` predicate key must be an identifier
3535
| ^^^^
3636

3737
error[E0537]: invalid predicate `a`
38-
--> $DIR/cfg-attr-syntax-validation.rs:19:7
38+
--> $DIR/cfg-attr-syntax-validation.rs:29:7
3939
|
4040
LL | #[cfg(a())] //~ ERROR invalid predicate `a`
4141
| ^^^
4242

4343
error: literal in `cfg` predicate value must be a string
44-
--> $DIR/cfg-attr-syntax-validation.rs:22:11
44+
--> $DIR/cfg-attr-syntax-validation.rs:32:11
4545
|
4646
LL | #[cfg(a = 10)] //~ ERROR literal in `cfg` predicate value must be a string
4747
| ^^
4848

4949
error: `cfg` is not a well-formed meta-item
50-
--> $DIR/cfg-attr-syntax-validation.rs:27:9
50+
--> $DIR/cfg-attr-syntax-validation.rs:37:9
5151
|
5252
LL | #[cfg(feature = $expr)] //~ ERROR `cfg` is not a well-formed meta-item
5353
| ^^^^^^^^^^^^^^^^^^^^^^^ help: expected syntax is: `#[cfg(/* predicate */)]`

0 commit comments

Comments
 (0)