Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update compile fail test error messages
Tohe update to syn 2.x introduced some minor changes in compilation error messages, most notably to #[construct_with] which required adding a secondary error to provide the same context-specific error message as before.
- Loading branch information
Showing
3 changed files
with
21 additions
and
6 deletions.
There are no files selected for viewing
14 changes: 10 additions & 4 deletions
14
pnet_macros/tests/compile-fail/construct-with-errors.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
error: #[construct_with] must have at least one argument | ||
--> $DIR/construct-with-errors.rs:20:7 | ||
--> tests/compile-fail/construct-with-errors.rs:20:7 | ||
| | ||
20 | #[construct_with()] //~ ERROR #[construct_with] must have at least one argument | ||
| ^^^^^^^^^^^^^^ | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: #[construct_with] should be of the form #[construct_with(<types>)] | ||
--> $DIR/construct-with-errors.rs:28:22 | ||
error: unexpected literal in nested attribute, expected ident | ||
--> tests/compile-fail/construct-with-errors.rs:28:22 | ||
| | ||
28 | #[construct_with("test")] //~ ERROR #[construct_with] should be of the form #[construct_with(<types>)] | ||
| ^^^^^^ | ||
|
||
error: #[construct_with] should be of the form #[construct_with(<primitive types>)] | ||
--> tests/compile-fail/construct-with-errors.rs:28:7 | ||
| | ||
28 | #[construct_with("test")] //~ ERROR #[construct_with] should be of the form #[construct_with(<types>)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
error: variable length field must have #[length = ""] or #[length_fn = ""] attribute | ||
--> $DIR/variable_length_fields.rs:16:17 | ||
--> tests/compile-fail/variable_length_fields.rs:16:17 | ||
| | ||
16 | var_length: Vec<u8>, //~ ERROR: variable length field must have #[length = ""] or #[length_fn = ""] attribute | ||
| ^^^ | ||
| ^^^^^^^ |