-
-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Relocate some code, improve internals
- Loading branch information
Showing
8 changed files
with
237 additions
and
226 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
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,16 +1,16 @@ | ||
use time::macros::declare_format_string; | ||
use time::serde; | ||
|
||
declare_format_string!(); // unexpected end of input | ||
declare_format_string!("bad string", OffsetDateTime, "[year] [month]"); // module name is not ident | ||
declare_format_string!(my_format: OffsetDateTime, "[year] [month]"); // not a comma | ||
declare_format_string!(my_format,); // missing formattable and string | ||
declare_format_string!(my_format, "[year] [month]"); // missing formattable | ||
declare_format_string!(OffsetDateTime, "[year] [month]"); // missing ident | ||
declare_format_string!(my_format, OffsetDateTime); // missing string format | ||
declare_format_string!(my_format, OffsetDateTime,); // missing string format | ||
declare_format_string!(my_format, OffsetDateTime "[year] [month]"); // missing comma | ||
declare_format_string!(my_format, OffsetDateTime : "[year] [month]"); // not a comma | ||
declare_format_string!(my_format, OffsetDateTime, "[bad]"); // bad component name | ||
declare_format_string!(my_format, OffsetDateTime, not_string); // string format wrong type | ||
serde::format_description!(); // unexpected end of input | ||
serde::format_description!("bad string", OffsetDateTime, "[year] [month]"); // module name is not ident | ||
serde::format_description!(my_format: OffsetDateTime, "[year] [month]"); // not a comma | ||
serde::format_description!(my_format,); // missing formattable and string | ||
serde::format_description!(my_format, "[year] [month]"); // missing formattable | ||
serde::format_description!(OffsetDateTime, "[year] [month]"); // missing ident | ||
serde::format_description!(my_format, OffsetDateTime); // missing string format | ||
serde::format_description!(my_format, OffsetDateTime,); // missing string format | ||
serde::format_description!(my_format, OffsetDateTime "[year] [month]"); // missing comma | ||
serde::format_description!(my_format, OffsetDateTime : "[year] [month]"); // not a comma | ||
serde::format_description!(my_format, OffsetDateTime, "[bad]"); // bad component name | ||
serde::format_description!(my_format, OffsetDateTime, not_string); // string format wrong type | ||
|
||
fn main() {} |
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,79 +1,79 @@ | ||
error: unexpected end of input | ||
--> $DIR/invalid_serializer.rs:3:1 | ||
| | ||
3 | declare_format_string!(); // unexpected end of input | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
3 | serde::format_description!(); // unexpected end of input | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: this error originates in the macro `declare_format_string` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
= note: this error originates in the macro `serde::format_description` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: unexpected token: "bad string" | ||
--> $DIR/invalid_serializer.rs:4:24 | ||
--> $DIR/invalid_serializer.rs:4:28 | ||
| | ||
4 | declare_format_string!("bad string", OffsetDateTime, "[year] [month]"); // module name is not ident | ||
| ^^^^^^^^^^^^ | ||
4 | serde::format_description!("bad string", OffsetDateTime, "[year] [month]"); // module name is not ident | ||
| ^^^^^^^^^^^^ | ||
|
||
error: unexpected token: : | ||
--> $DIR/invalid_serializer.rs:5:33 | ||
--> $DIR/invalid_serializer.rs:5:37 | ||
| | ||
5 | declare_format_string!(my_format: OffsetDateTime, "[year] [month]"); // not a comma | ||
| ^ | ||
5 | serde::format_description!(my_format: OffsetDateTime, "[year] [month]"); // not a comma | ||
| ^ | ||
|
||
error: unexpected end of input | ||
--> $DIR/invalid_serializer.rs:6:1 | ||
| | ||
6 | declare_format_string!(my_format,); // missing formattable and string | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
6 | serde::format_description!(my_format,); // missing formattable and string | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: this error originates in the macro `declare_format_string` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
= note: this error originates in the macro `serde::format_description` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: unexpected token: "[year] [month]" | ||
--> $DIR/invalid_serializer.rs:7:35 | ||
--> $DIR/invalid_serializer.rs:7:39 | ||
| | ||
7 | declare_format_string!(my_format, "[year] [month]"); // missing formattable | ||
| ^^^^^^^^^^^^^^^^ | ||
7 | serde::format_description!(my_format, "[year] [month]"); // missing formattable | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: unexpected token: "[year] [month]" | ||
--> $DIR/invalid_serializer.rs:8:40 | ||
--> $DIR/invalid_serializer.rs:8:44 | ||
| | ||
8 | declare_format_string!(OffsetDateTime, "[year] [month]"); // missing ident | ||
| ^^^^^^^^^^^^^^^^ | ||
8 | serde::format_description!(OffsetDateTime, "[year] [month]"); // missing ident | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: unexpected end of input | ||
--> $DIR/invalid_serializer.rs:9:1 | ||
| | ||
9 | declare_format_string!(my_format, OffsetDateTime); // missing string format | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
9 | serde::format_description!(my_format, OffsetDateTime); // missing string format | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: this error originates in the macro `declare_format_string` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
= note: this error originates in the macro `serde::format_description` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: expected string | ||
--> $DIR/invalid_serializer.rs:10:1 | ||
| | ||
10 | declare_format_string!(my_format, OffsetDateTime,); // missing string format | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
10 | serde::format_description!(my_format, OffsetDateTime,); // missing string format | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: this error originates in the macro `declare_format_string` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
= note: this error originates in the macro `serde::format_description` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: unexpected token: "[year] [month]" | ||
--> $DIR/invalid_serializer.rs:11:50 | ||
--> $DIR/invalid_serializer.rs:11:54 | ||
| | ||
11 | declare_format_string!(my_format, OffsetDateTime "[year] [month]"); // missing comma | ||
| ^^^^^^^^^^^^^^^^ | ||
11 | serde::format_description!(my_format, OffsetDateTime "[year] [month]"); // missing comma | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: unexpected token: : | ||
--> $DIR/invalid_serializer.rs:12:50 | ||
--> $DIR/invalid_serializer.rs:12:54 | ||
| | ||
12 | declare_format_string!(my_format, OffsetDateTime : "[year] [month]"); // not a comma | ||
| ^ | ||
12 | serde::format_description!(my_format, OffsetDateTime : "[year] [month]"); // not a comma | ||
| ^ | ||
|
||
error: invalid component name `bad` at byte index 1 | ||
--> $DIR/invalid_serializer.rs:13:51 | ||
--> $DIR/invalid_serializer.rs:13:55 | ||
| | ||
13 | declare_format_string!(my_format, OffsetDateTime, "[bad]"); // bad component name | ||
| ^^^^^^^ | ||
13 | serde::format_description!(my_format, OffsetDateTime, "[bad]"); // bad component name | ||
| ^^^^^^^ | ||
|
||
error: expected string | ||
--> $DIR/invalid_serializer.rs:14:51 | ||
--> $DIR/invalid_serializer.rs:14:55 | ||
| | ||
14 | declare_format_string!(my_format, OffsetDateTime, not_string); // string format wrong type | ||
| ^^^^^^^^^^ | ||
14 | serde::format_description!(my_format, OffsetDateTime, not_string); // string format wrong type | ||
| ^^^^^^^^^^ |
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.