Skip to content

Commit 836a0e0

Browse files
committed
Adjust tests/ui/attrs-resolution-errors.rs
- Move `tests/ui/attrs-resolution-errors.rs` to `tests/ui/resolve/`. - Document test intent. - Rename test to `attr-macros-positional-rejection.rs` to better reflect test intent.
1 parent 7424b89 commit 836a0e0

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

Diff for: tests/ui/attrs-resolution-errors.rs renamed to tests/ui/resolve/attr-macros-positional-rejection.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
//! Check that certain positions (listed below) only permit *non-macro* attributes and reject
2+
//! attribute macros:
3+
//!
4+
//! - Enum variants
5+
//! - Struct fields
6+
//! - Field in a struct pattern
7+
//! - Match arm
8+
//! - Field in struct initialization expression
9+
110
enum FooEnum {
211
#[test]
312
//~^ ERROR expected non-macro attribute, found attribute macro
@@ -32,7 +41,7 @@ fn main() {
3241
_ => {}
3342
}
3443

35-
let _another_foo_strunct = FooStruct {
44+
let _another_foo_struct = FooStruct {
3645
#[test]
3746
//~^ ERROR expected non-macro attribute, found attribute macro
3847
bar: 1,

Diff for: tests/ui/attrs-resolution-errors.stderr renamed to tests/ui/resolve/attr-macros-positional-rejection.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
error: expected non-macro attribute, found attribute macro `test`
2-
--> $DIR/attrs-resolution-errors.rs:2:7
2+
--> $DIR/attr-macros-positional-rejection.rs:11:7
33
|
44
LL | #[test]
55
| ^^^^ not a non-macro attribute
66

77
error: expected non-macro attribute, found attribute macro `test`
8-
--> $DIR/attrs-resolution-errors.rs:8:7
8+
--> $DIR/attr-macros-positional-rejection.rs:17:7
99
|
1010
LL | #[test]
1111
| ^^^^ not a non-macro attribute
1212

1313
error: expected non-macro attribute, found attribute macro `test`
14-
--> $DIR/attrs-resolution-errors.rs:23:15
14+
--> $DIR/attr-macros-positional-rejection.rs:32:15
1515
|
1616
LL | #[test] bar
1717
| ^^^^ not a non-macro attribute
1818

1919
error: expected non-macro attribute, found attribute macro `test`
20-
--> $DIR/attrs-resolution-errors.rs:30:11
20+
--> $DIR/attr-macros-positional-rejection.rs:39:11
2121
|
2222
LL | #[test]
2323
| ^^^^ not a non-macro attribute
2424

2525
error: expected non-macro attribute, found attribute macro `test`
26-
--> $DIR/attrs-resolution-errors.rs:36:11
26+
--> $DIR/attr-macros-positional-rejection.rs:45:11
2727
|
2828
LL | #[test]
2929
| ^^^^ not a non-macro attribute

0 commit comments

Comments
 (0)