Skip to content

Commit 8ce761d

Browse files
committed
Updates to tests.
1 parent 75d6293 commit 8ce761d

File tree

4 files changed

+20
-17
lines changed

4 files changed

+20
-17
lines changed

src/test/pretty/ast-stmt-expr-attr.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ fn syntax() {
4343
#![attr]
4444
};
4545
let _ =
46-
#[attr] match true
47-
{
48-
#[attr]
49-
_ => false,
46+
#[attr] match true {
47+
#![attr]
48+
#[attr]
49+
_ => false,
5050
};
5151
let _ = #[attr] || #[attr] foo;
5252
let _ = #[attr] move || #[attr] foo;

src/test/pretty/stmt_expr_attributes.rs

+14-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,16 @@ fn _3() {
4141
fn _4() {
4242

4343
#[rustc_dummy]
44-
match () { _ => (), }
44+
match () {
45+
#![rustc_dummy]
46+
_ => (),
47+
}
4548

46-
let _ = #[rustc_dummy] match () { () => (), };
49+
let _ =
50+
#[rustc_dummy] match () {
51+
#![rustc_dummy]
52+
() => (),
53+
};
4754
}
4855

4956
fn _5() {
@@ -164,7 +171,11 @@ fn _11() {
164171
#[rustc_dummy] loop {
165172
#![rustc_dummy]
166173
};
167-
let _ = #[rustc_dummy] match false { _ => (), };
174+
let _ =
175+
#[rustc_dummy] match false {
176+
#![rustc_dummy]
177+
_ => (),
178+
};
168179
let _ = #[rustc_dummy] || #[rustc_dummy] ();
169180
let _ = #[rustc_dummy] move || #[rustc_dummy] ();
170181
let _ =

src/test/ui/parser/stmt_expr_attrs_placement.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fn main() {
3030
//~^ ERROR an inner attribute is not permitted in this context
3131

3232
let g = match true { #![allow(warnings)] _ => {} };
33-
//~^ ERROR an inner attribute is not permitted in this context
33+
3434

3535
struct MyStruct { field: u8 }
3636
let h = MyStruct { #![allow(warnings)] field: 0 };

src/test/ui/parser/stmt_expr_attrs_placement.stderr

+1-9
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,6 @@ LL | let f = [#![allow(warnings)] 1; 0];
4646
|
4747
= note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them.
4848

49-
error: an inner attribute is not permitted in this context
50-
--> $DIR/stmt_expr_attrs_placement.rs:32:26
51-
|
52-
LL | let g = match true { #![allow(warnings)] _ => {} };
53-
| ^^^^^^^^^^^^^^^^^^^
54-
|
55-
= note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them.
56-
5749
error: an inner attribute is not permitted in this context
5850
--> $DIR/stmt_expr_attrs_placement.rs:36:24
5951
|
@@ -62,5 +54,5 @@ LL | let h = MyStruct { #![allow(warnings)] field: 0 };
6254
|
6355
= note: inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files. Outer attributes, like `#[test]`, annotate the item following them.
6456

65-
error: aborting due to 8 previous errors
57+
error: aborting due to 7 previous errors
6658

0 commit comments

Comments
 (0)