Skip to content

Commit

Permalink
Adjust tests/ui/attrs-resolution-errors.rs
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
jieyouxu committed Dec 17, 2024
1 parent 7424b89 commit 836a0e0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
//! Check that certain positions (listed below) only permit *non-macro* attributes and reject
//! attribute macros:
//!
//! - Enum variants
//! - Struct fields
//! - Field in a struct pattern
//! - Match arm
//! - Field in struct initialization expression
enum FooEnum {
#[test]
//~^ ERROR expected non-macro attribute, found attribute macro
Expand Down Expand Up @@ -32,7 +41,7 @@ fn main() {
_ => {}
}

let _another_foo_strunct = FooStruct {
let _another_foo_struct = FooStruct {
#[test]
//~^ ERROR expected non-macro attribute, found attribute macro
bar: 1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
error: expected non-macro attribute, found attribute macro `test`
--> $DIR/attrs-resolution-errors.rs:2:7
--> $DIR/attr-macros-positional-rejection.rs:11:7
|
LL | #[test]
| ^^^^ not a non-macro attribute

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

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

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

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

0 comments on commit 836a0e0

Please sign in to comment.