-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reimplement attribute parsing without darling
- Loading branch information
Showing
15 changed files
with
730 additions
and
566 deletions.
There are no files selected for viewing
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,31 +1,23 @@ | ||
error: Unknown field: `path` | ||
error: unrecognized derive_builder attribute | ||
--> tests/compile-fail/build_fn_error.rs:4:52 | ||
| | ||
4 | #[builder(build_fn(error(validation_error = false, path = "hello")))] | ||
| ^^^^ | ||
|
||
error: Cannot set `error(validation_error = false)` when using `validate` | ||
--> tests/compile-fail/build_fn_error.rs:10:45 | ||
error: `error(validation_error = false)` cannot be set when using `validate` | ||
--> tests/compile-fail/build_fn_error.rs:10:53 | ||
| | ||
10 | #[builder(build_fn(error(validation_error = false), validate = "hello"))] | ||
| ^^^^^ | ||
| ^^^^^^^^^^^^^^^^^^ | ||
|
||
error: Unknown field: `path` | ||
error: unrecognized derive_builder attribute | ||
--> tests/compile-fail/build_fn_error.rs:16:26 | ||
| | ||
16 | #[builder(build_fn(error(path = "hello")))] | ||
| ^^^^ | ||
|
||
error: Missing field `validation_error` at build_fn/error | ||
--> tests/compile-fail/build_fn_error.rs:15:10 | ||
| | ||
15 | #[derive(Builder)] | ||
| ^^^^^^^ | ||
| | ||
= note: this error originates in the derive macro `Builder` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: Missing field `validation_error` | ||
--> tests/compile-fail/build_fn_error.rs:22:20 | ||
error: unexpected end of input, expected nested attribute | ||
--> tests/compile-fail/build_fn_error.rs:22:26 | ||
| | ||
22 | #[builder(build_fn(error()))] | ||
| ^^^^^ | ||
| ^ |
18 changes: 9 additions & 9 deletions
18
derive_builder/tests/compile-fail/builder_field_custom.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,23 +1,23 @@ | ||
error: #[builder(default)] and #[builder(field(build="..."))] cannot be used together | ||
--> tests/compile-fail/builder_field_custom.rs:8:19 | ||
--> tests/compile-fail/builder_field_custom.rs:9:9 | ||
| | ||
8 | default = "1", | ||
| ^^^ | ||
9 | field(build = "self.ipsum.map(|v| v + 42).unwrap_or(100)") | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: #[builder(default)] and #[builder(field(ty="..."))] cannot be used together | ||
--> tests/compile-fail/builder_field_custom.rs:14:25 | ||
--> tests/compile-fail/builder_field_custom.rs:14:30 | ||
| | ||
14 | #[builder(default = "2", field(ty = "usize"))] | ||
| ^^^ | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: #[builder(default)] and #[builder(field(build="..."))] cannot be used together | ||
--> tests/compile-fail/builder_field_custom.rs:18:25 | ||
--> tests/compile-fail/builder_field_custom.rs:18:30 | ||
| | ||
18 | #[builder(default = "3", field(ty = "usize", build = "self.ipsum + 42"))] | ||
| ^^^ | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: #[builder(default)] and #[builder(field(ty="..."))] cannot be used together | ||
--> tests/compile-fail/builder_field_custom.rs:18:25 | ||
--> tests/compile-fail/builder_field_custom.rs:18:30 | ||
| | ||
18 | #[builder(default = "3", field(ty = "usize", build = "self.ipsum + 42"))] | ||
| ^^^ | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
10 changes: 6 additions & 4 deletions
10
derive_builder/tests/compile-fail/deny_empty_default.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,5 +1,7 @@ | ||
error: Unknown literal value `` | ||
--> $DIR/deny_empty_default.rs:8:25 | ||
error: unexpected end of input, expected expression | ||
--> tests/compile-fail/deny_empty_default.rs:6:10 | ||
| | ||
8 | #[builder(default = "")] | ||
| ^^ | ||
6 | #[derive(Builder)] | ||
| ^^^^^^^ | ||
| | ||
= note: this error originates in the derive macro `Builder` (in Nightly builds, run with -Z macro-backtrace for more info) |
2 changes: 1 addition & 1 deletion
2
derive_builder/tests/compile-fail/rename_setter_struct_level.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
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
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
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
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
Oops, something went wrong.