Skip to content

Commit eb86917

Browse files
Update uitests
1 parent 1095c71 commit eb86917

12 files changed

Lines changed: 138 additions & 131 deletions

tests/ui/attributes/attr-mix-new.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#[rustc_dummy(bar)]
66
mod foo {
77
#![feature(globs)]
8-
//~^ WARN crate-level attribute should be in the root module
8+
//~^ WARN the `#![feature]` attribute can only be used at the crate root
99
}
1010

1111
fn main() {}

tests/ui/attributes/attr-mix-new.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
warning: crate-level attribute should be in the root module
1+
warning: the `#![feature]` attribute can only be used at the crate root
22
--> $DIR/attr-mix-new.rs:7:3
33
|
44
LL | #![feature(globs)]

tests/ui/consts/const-block-items/hir.stdout

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
//@ build-pass
2-
//@ compile-flags: -Zunpretty=hir
3-
4-
#![feature(const_block_items)]
1+
#![attr = Feature([const_block_items#0])]
52
extern crate std;
63
#[attr = PreludeImport]
74
use ::std::prelude::rust_2015::*;
5+
//@ build-pass
6+
//@ compile-flags: -Zunpretty=hir
7+
88

99
const _: () =
1010
{

tests/ui/empty/empty-attributes.stderr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,6 @@ LL | #![forbid()]
4343
|
4444
= note: attribute `forbid` with an empty list has no effect
4545

46-
error: unused attribute
47-
--> $DIR/empty-attributes.rs:7:1
48-
|
49-
LL | #![feature()]
50-
| ^^^^^^^^^^^^^ help: remove this attribute
51-
|
52-
= note: attribute `feature` with an empty list has no effect
53-
5446
error: unused attribute
5547
--> $DIR/empty-attributes.rs:9:1
5648
|
@@ -67,5 +59,13 @@ LL | #[target_feature()]
6759
|
6860
= note: using `target_feature` with an empty list has no effect
6961

62+
error: unused attribute
63+
--> $DIR/empty-attributes.rs:7:1
64+
|
65+
LL | #![feature()]
66+
| ^^^^^^^^^^^^^ help: remove this attribute
67+
|
68+
= note: using `feature` with an empty list has no effect
69+
7070
error: aborting due to 8 previous errors
7171

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#![forbid(unstable_features)]
22
#![feature(intrinsics)] //~ ERROR unstable feature
33

4-
fn main() { }
4+
fn main() {}
Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
error[E0556]: malformed `feature` attribute input
2-
--> $DIR/gated-bad-feature.rs:1:25
3-
|
4-
LL | #![feature(foo_bar_baz, foo(bar), foo = "baz", foo)]
5-
| ^^^^^^^^ help: expected just one word: `foo`
6-
7-
error[E0556]: malformed `feature` attribute input
8-
--> $DIR/gated-bad-feature.rs:1:35
9-
|
10-
LL | #![feature(foo_bar_baz, foo(bar), foo = "baz", foo)]
11-
| ^^^^^^^^^^^ help: expected just one word: `foo`
12-
131
error[E0557]: feature has been removed
142
--> $DIR/gated-bad-feature.rs:8:12
153
|
@@ -18,17 +6,41 @@ LL | #![feature(test_removed_feature)]
186
|
197
= note: removed in 1.0.0
208

21-
error: malformed `feature` attribute input
9+
error[E0565]: malformed `feature` attribute input
10+
--> $DIR/gated-bad-feature.rs:1:1
11+
|
12+
LL | #![feature(foo_bar_baz, foo(bar), foo = "baz", foo)]
13+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^-----^^^^^^^^^^^^^^^^^^^^
14+
| | |
15+
| | didn't expect any arguments here
16+
| help: must be of the form: `#![feature(feature1, feature2, ...)]`
17+
18+
error[E0565]: malformed `feature` attribute input
19+
--> $DIR/gated-bad-feature.rs:1:1
20+
|
21+
LL | #![feature(foo_bar_baz, foo(bar), foo = "baz", foo)]
22+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------^^^^^^^
23+
| | |
24+
| | didn't expect any arguments here
25+
| help: must be of the form: `#![feature(feature1, feature2, ...)]`
26+
27+
error[E0539]: malformed `feature` attribute input
2228
--> $DIR/gated-bad-feature.rs:6:1
2329
|
2430
LL | #![feature]
25-
| ^^^^^^^^^^^ help: must be of the form: `#![feature(name1, name2, ...)]`
31+
| ^^^^^^^^^^^
32+
| |
33+
| expected this to be a list
34+
| help: must be of the form: `#![feature(feature1, feature2, ...)]`
2635

27-
error: malformed `feature` attribute input
36+
error[E0539]: malformed `feature` attribute input
2837
--> $DIR/gated-bad-feature.rs:7:1
2938
|
3039
LL | #![feature = "foo"]
31-
| ^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#![feature(name1, name2, ...)]`
40+
| ^^^^^^^^^^^-------^
41+
| | |
42+
| | expected this to be a list
43+
| help: must be of the form: `#![feature(feature1, feature2, ...)]`
3244

3345
error[E0635]: unknown feature `foo_bar_baz`
3446
--> $DIR/gated-bad-feature.rs:1:12
@@ -44,5 +56,5 @@ LL | #![feature(foo_bar_baz, foo(bar), foo = "baz", foo)]
4456

4557
error: aborting due to 7 previous errors
4658

47-
Some errors have detailed explanations: E0556, E0557, E0635.
48-
For more information about an error, try `rustc --explain E0556`.
59+
Some errors have detailed explanations: E0539, E0557, E0565, E0635.
60+
For more information about an error, try `rustc --explain E0539`.

tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -859,26 +859,26 @@ mod crate_type {
859859

860860
#[feature(x0600)]
861861
//~^ WARN crate-level attribute should be an inner attribute
862-
//~| HELP add a `!`
863862
mod feature {
863+
//~^ NOTE this attribute does not have an `!`, which means it is applied to this module
864864
mod inner { #![feature(x0600)] }
865-
//~^ WARN crate-level attribute should be in the root module
865+
//~^ WARN the `#![feature]` attribute can only be used at the crate root
866866

867867
#[feature(x0600)] fn f() { }
868868
//~^ WARN crate-level attribute should be an inner attribute
869-
//~| HELP add a `!`
869+
//~| NOTE this attribute does not have an `!`, which means it is applied to this function
870870

871871
#[feature(x0600)] struct S;
872872
//~^ WARN crate-level attribute should be an inner attribute
873-
//~| HELP add a `!`
873+
//~| NOTE this attribute does not have an `!`, which means it is applied to this struct
874874

875875
#[feature(x0600)] type T = S;
876876
//~^ WARN crate-level attribute should be an inner attribute
877-
//~| HELP add a `!`
877+
//~| NOTE this attribute does not have an `!`, which means it is applied to this type alias
878878

879879
#[feature(x0600)] impl S { }
880880
//~^ WARN crate-level attribute should be an inner attribute
881-
//~| HELP add a `!`
881+
//~| NOTE this attribute does not have an `!`, which means it is applied to this implementation block
882882
}
883883

884884

tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr

Lines changed: 70 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -207,17 +207,6 @@ note: the lint level is defined here
207207
LL | #![warn(unused_attributes, unknown_lints)]
208208
| ^^^^^^^^^^^^^^^^^
209209

210-
warning: crate-level attribute should be an inner attribute
211-
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:860:1
212-
|
213-
LL | #[feature(x0600)]
214-
| ^^^^^^^^^^^^^^^^^
215-
|
216-
help: add a `!`
217-
|
218-
LL | #![feature(x0600)]
219-
| +
220-
221210
warning: attribute should be applied to an `extern` block with non-Rust ABI
222211
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:71:1
223212
|
@@ -282,56 +271,6 @@ LL | #[link(name = "x")] extern "Rust" {}
282271
|
283272
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
284273

285-
warning: crate-level attribute should be in the root module
286-
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:864:17
287-
|
288-
LL | mod inner { #![feature(x0600)] }
289-
| ^^^^^^^^^^^^^^^^^^
290-
291-
warning: crate-level attribute should be an inner attribute
292-
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:867:5
293-
|
294-
LL | #[feature(x0600)] fn f() { }
295-
| ^^^^^^^^^^^^^^^^^
296-
|
297-
help: add a `!`
298-
|
299-
LL | #![feature(x0600)] fn f() { }
300-
| +
301-
302-
warning: crate-level attribute should be an inner attribute
303-
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:871:5
304-
|
305-
LL | #[feature(x0600)] struct S;
306-
| ^^^^^^^^^^^^^^^^^
307-
|
308-
help: add a `!`
309-
|
310-
LL | #![feature(x0600)] struct S;
311-
| +
312-
313-
warning: crate-level attribute should be an inner attribute
314-
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:875:5
315-
|
316-
LL | #[feature(x0600)] type T = S;
317-
| ^^^^^^^^^^^^^^^^^
318-
|
319-
help: add a `!`
320-
|
321-
LL | #![feature(x0600)] type T = S;
322-
| +
323-
324-
warning: crate-level attribute should be an inner attribute
325-
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:879:5
326-
|
327-
LL | #[feature(x0600)] impl S { }
328-
| ^^^^^^^^^^^^^^^^^
329-
|
330-
help: add a `!`
331-
|
332-
LL | #![feature(x0600)] impl S { }
333-
| +
334-
335274
warning: `#[macro_use]` attribute cannot be used on functions
336275
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:190:5
337276
|
@@ -1303,6 +1242,76 @@ note: this attribute does not have an `!`, which means it is applied to this imp
13031242
LL | #[crate_type = "0800"] impl S { }
13041243
| ^^^^^^^^^^
13051244

1245+
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![feature]`
1246+
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:860:1
1247+
|
1248+
LL | #[feature(x0600)]
1249+
| ^^^^^^^^^^^^^^^^^
1250+
|
1251+
note: this attribute does not have an `!`, which means it is applied to this module
1252+
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:862:1
1253+
|
1254+
LL | / mod feature {
1255+
LL | |
1256+
LL | | mod inner { #![feature(x0600)] }
1257+
... |
1258+
LL | | }
1259+
| |_^
1260+
1261+
warning: the `#![feature]` attribute can only be used at the crate root
1262+
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:864:17
1263+
|
1264+
LL | mod inner { #![feature(x0600)] }
1265+
| ^^^^^^^^^^^^^^^^^^
1266+
1267+
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![feature]`
1268+
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:867:5
1269+
|
1270+
LL | #[feature(x0600)] fn f() { }
1271+
| ^^^^^^^^^^^^^^^^^
1272+
|
1273+
note: this attribute does not have an `!`, which means it is applied to this function
1274+
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:867:23
1275+
|
1276+
LL | #[feature(x0600)] fn f() { }
1277+
| ^^^^^^^^^^
1278+
1279+
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![feature]`
1280+
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:871:5
1281+
|
1282+
LL | #[feature(x0600)] struct S;
1283+
| ^^^^^^^^^^^^^^^^^
1284+
|
1285+
note: this attribute does not have an `!`, which means it is applied to this struct
1286+
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:871:23
1287+
|
1288+
LL | #[feature(x0600)] struct S;
1289+
| ^^^^^^^^^
1290+
1291+
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![feature]`
1292+
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:875:5
1293+
|
1294+
LL | #[feature(x0600)] type T = S;
1295+
| ^^^^^^^^^^^^^^^^^
1296+
|
1297+
note: this attribute does not have an `!`, which means it is applied to this type alias
1298+
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:875:23
1299+
|
1300+
LL | #[feature(x0600)] type T = S;
1301+
| ^^^^^^^^^^^
1302+
1303+
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![feature]`
1304+
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:879:5
1305+
|
1306+
LL | #[feature(x0600)] impl S { }
1307+
| ^^^^^^^^^^^^^^^^^
1308+
|
1309+
note: this attribute does not have an `!`, which means it is applied to this implementation block
1310+
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:879:23
1311+
|
1312+
LL | #[feature(x0600)] impl S { }
1313+
| ^^^^^^^^^^
1314+
13061315
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_main]`
13071316
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:885:1
13081317
|

tests/ui/parser/inner-attr.stderr

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,18 @@ LL | fn main() {}
1111
|
1212
= note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
1313

14-
warning: crate-level attribute should be an inner attribute
14+
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![feature]`
1515
--> $DIR/inner-attr.rs:1:1
1616
|
1717
LL | #[feature(lang_items)]
1818
| ^^^^^^^^^^^^^^^^^^^^^^
1919
|
20-
= note: requested on the command line with `-W unused-attributes`
21-
help: add a `!`
20+
note: this attribute does not have an `!`, which means it is applied to this function
21+
--> $DIR/inner-attr.rs:4:1
2222
|
23-
LL | #![feature(lang_items)]
24-
| +
23+
LL | fn main() {}
24+
| ^^^^^^^^^^^^
25+
= note: requested on the command line with `-W unused-attributes`
2526

2627
error: aborting due to 1 previous error; 1 warning emitted
2728

tests/ui/type-alias-impl-trait/issue-60662.stdout

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
#![attr = Feature([type_alias_impl_trait#0])]
2+
extern crate std;
3+
#[attr = PreludeImport]
4+
use ::std::prelude::rust_2015::*;
15
//@ check-pass
26
//@ compile-flags: -Z unpretty=hir
37
//@ edition: 2015
48

5-
#![feature(type_alias_impl_trait)]
6-
extern crate std;
7-
#[attr = PreludeImport]
8-
use ::std::prelude::rust_2015::*;
99

1010
trait Animal { }
1111

0 commit comments

Comments
 (0)