Commit Graph

57 Commits

Author SHA1 Message Date
David Tolnay b2b3bae1db
Release 1.0.3 2019-10-19 08:56:47 -04:00
David Tolnay 7460283927
Allow ident containing number
Fixes #34.
2019-10-19 08:55:58 -04:00
David Tolnay ee864e1641
Release 1.0.2 2019-10-12 18:19:41 -07:00
David Tolnay 46de723f20
Support backtrace in From impl 2019-10-12 18:08:20 -07:00
David Tolnay 0e8d1baa69
Detect extraneous fields before generating From 2019-10-12 17:55:29 -07:00
David Tolnay 2492735b67
Detect multiple variants having same From type 2019-10-12 17:55:29 -07:00
David Tolnay f3b38c3a8a
Implement From for enums 2019-10-12 17:55:29 -07:00
David Tolnay 946be606a9
Implement From for structs 2019-10-12 17:55:29 -07:00
David Tolnay 03e77b3d2b
Treat the #[from] field implicitly as source 2019-10-12 17:55:29 -07:00
David Tolnay 2305f75976
Validate #[from] attribute 2019-10-12 17:55:29 -07:00
David Tolnay 8cbc50e05a
Parse #[from] attribute 2019-10-12 17:30:09 -07:00
David Tolnay 0c5e34fb12
Rename attr validation methods 2019-10-12 17:27:40 -07:00
David Tolnay f16952290d
Simplify storage of source and backtrace attrs 2019-10-12 16:28:24 -07:00
David Tolnay fac0a7aa0d
Support Option<Backtrace> 2019-10-12 16:07:23 -07:00
David Tolnay f18a2a605d
Support Option<$source> 2019-10-12 16:07:23 -07:00
David Tolnay 2c9bcc5347
Elevate precedence of explicitly marked backtrace 2019-10-12 15:24:15 -07:00
David Tolnay 18f2337ffc
Prefer the source's backtrace if it has one 2019-10-12 15:11:48 -07:00
David Tolnay 72cf49ccd4
#[backtrace] attribute for explicitly selecting the backtrace field 2019-10-12 15:02:11 -07:00
David Tolnay de6719e923
Improve span for the enum case 2019-10-12 15:01:57 -07:00
David Tolnay 098dcf26c3
Improve span when source is not an Error 2019-10-12 14:56:08 -07:00
David Tolnay 6b35d7f73c
Assume #[source] attribute for fields named `source` 2019-10-12 14:20:33 -07:00
David Tolnay 5ea03dd7da
Support Display impl for void enums 2019-10-12 13:53:39 -07:00
David Tolnay aa123cfe0c
Reject display attribute on a field 2019-10-12 13:45:26 -07:00
David Tolnay 10d1f640da
Reject source attribute not on a field 2019-10-12 13:42:11 -07:00
David Tolnay 41068e5435
Variants inherit fmt attr from the enum 2019-10-12 13:30:32 -07:00
David Tolnay d42a95076c
Detect duplicate source attributes 2019-10-12 13:03:43 -07:00
David Tolnay 68c18d6ecf
Move more tree analysis logic to prop.rs 2019-10-12 12:26:50 -07:00
David Tolnay 1764ddeae4
Perform all validation up front 2019-10-12 11:41:36 -07:00
David Tolnay e3f152983c
Record original syntax tree references for error reporting 2019-10-12 11:17:30 -07:00
David Tolnay 69052f88d8
Switch expansion to use new ast 2019-10-12 11:17:30 -07:00
David Tolnay 60987ffa76
Introduce syntax tree that makes validations easier 2019-10-12 11:16:54 -07:00
David Tolnay 5b0d29a6e5
Restore support for rustc <1.36 2019-10-12 11:08:32 -07:00
David Tolnay b78fe1891b
Detect duplicate attributes on the same syntax tree node 2019-10-12 09:49:36 -07:00
David Tolnay 3d43d39ed1
Uniformly parse all attributes in all positions 2019-10-12 09:44:26 -07:00
David Tolnay ab48dd19d3
Resolve iter_skip_next lint 2019-10-11 11:12:28 -07:00
David Tolnay 5994705b38
Generate more concise code for pass-through format
Fixes #13.
2019-10-11 11:05:09 -07:00
David Tolnay a6b1d28e40
Keep track of whether fmt string uses shorthand 2019-10-11 11:05:09 -07:00
David Tolnay 7fa5b8114d
Accept `.var` shorthand inside of parens 2019-10-11 10:46:20 -07:00
David Tolnay e50cf82f33
Extract the fmt args parser to a function 2019-10-11 10:46:20 -07:00
David Tolnay 8b31ec6fd0
Format with rustfmt 2019-09-08 2019-10-11 10:46:20 -07:00
David Tolnay 86f6b3bc4a
Release 1.0.0 2019-10-09 11:05:13 -07:00
David Tolnay 7d26b19d07
Fill in crates.io metadata 2019-10-09 11:05:12 -07:00
David Tolnay c0d3d564cf
Resolve range_plus_one lint 2019-10-09 10:30:24 -07:00
David Tolnay 490c962d68
Avoid enum variants through Self
To support compilers older than rustc 1.37.
2019-10-09 10:27:39 -07:00
David Tolnay 95cd9864d6
Accept shorthand for the format string 2019-10-09 10:23:20 -07:00
David Tolnay 69df19571a
Implement Display for enums 2019-10-09 09:03:51 -07:00
David Tolnay 63ba03bacb
Implement Display for structs 2019-10-09 08:45:29 -07:00
David Tolnay 8e866cde57
Error implementation for enums 2019-10-09 08:12:22 -07:00
David Tolnay 761ff1c708
Support any source() that derefs to std::error::Error 2019-10-09 07:33:17 -07:00
David Tolnay bb13f4b07a
Improve error position when cause is wrong type 2019-10-09 07:30:46 -07:00