Commit graph

313 commits

Author SHA1 Message Date
Matthew Donoughe
aa19b7cfce
suppress needless_lifetimes lints from clippy 0.1.83 2024-12-03 08:40:10 -05:00
David Tolnay
15fd26e476
Release 2.0.3 2024-11-10 13:17:27 -08:00
David Tolnay
7046023130
Simplify how has_bonus_display is accumulated 2024-11-10 13:15:46 -08:00
David Tolnay
1d040f358a
Use Var wrapper only for Pointer formatting 2024-11-10 13:11:21 -08:00
David Tolnay
63882935be
Support Display and Debug of same path in error message 2024-11-10 12:59:19 -08:00
David Tolnay
dc0359eeec
Defer binding_value construction 2024-11-10 12:59:17 -08:00
David Tolnay
49be39dee1
Release 2.0.2 2024-11-09 22:28:33 -08:00
David Tolnay
2e43d26838 Release 1.0.69
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEERijF2Cz/ZdaBZKeK+boUO5X/bYIFAmcwUXUACgkQ+boUO5X/
 bYLChBAAiO3silasUL5uxnLNwC3r9IaprdnBHRr69V/7UFGcAWQEN/JMxl+klN4p
 /4J8cIJmOFvdR7slB7tEtgkb3P4H4UlO9QGmKcHc86W6TXDztthC2b4eaXKEEPRN
 lYxs92iaHBuDSZR7DQ8NjhnPwLFlhoePFGrThNscy7e7e2Qtf2RP4pEeOQwTKIM5
 KlBlgpFK+81hP7SruhZHiYMBkA4vbQvwqoRTw+Xszi+olDdnqEntM+ySgfbpbl1H
 Gdp7C3+FhTRMSJLofNvEzBTWYv4coOZoDhkEJgXLdRhVomkFIHHMFYiaG6ldXp7n
 95hd8KXOfGF41oLmfuPkWDdXgZYlawale4a+g4W9P4Aa8ecW6fW15EvrrZEPtyt7
 fVApcMWWn8s174u4inaE2v5FY2gs2lOlxPCVvRUPB16R1T8XJhSHi4VWgKKSo/Jo
 gDDLvP+pSRHrC9qIlnkP0XuSK5GjVdymGalUlyUe9JAXmxP90m9jUBYH15WTrTjn
 qf0g4KYh6YgOYnUKU3qbYdkNlipjR5I/ISknBgDXcNipGdG1UdBRkGTbA2IquewV
 XD/SGhQ8az35pY4SYQRf3yS33DbNNCcBovBQe3u+phHhinGzils6A8ehK5NduxzL
 jyRJlq9mvE7+gkTzozKUkJFLLiT7RP9DtQy+yOlos9sHvJQTsI8=
 =OL7Q
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEERijF2Cz/ZdaBZKeK+boUO5X/bYIFAmcwUicACgkQ+boUO5X/
 bYLv1A//bx+ux6KQd6+f8pAesRkXppDTtvSm0TNuMigFFBfXPE/JWlB995eOm1Wy
 LlECgl8hOEf4NF4eiqdgNiqa1n6sY8neqiMDjW4rwl4kaX8dDkBWVEX4Lym8Q3Xt
 9OcdiNQOdlVoimeFkizfjDEpYywaeleSNurQ1Id2P/VgWrhnaIRUymYzni+fS98H
 HCaAmlf+dfvyyiVNlikJAg/DrMCXKyiX4jVu8KZ6PHJvvfrbS/VXqrh9+tah1vxg
 u1DxChokNIllt0Fm+3laFYg/5WwSJuHdn1mJDkh1kWxmdryKIb4Y+dAx6Xp/6BKb
 YefRZGUlChrQzbhxTQ6F6GXZqMeV0JJKknYPQ7+Cm1kQDtYS7tCueiUWT/82ZFnD
 ETGKIFJuFxnV0YcX0cNCRGo/ZJW5rmnhIFMwYbIma4q9j7zg+Fwn9XHeXbdyX6lC
 99uB833bRah8VTL1n/kviLD12eYm7JbahFGluVlLEjFnDjI1oiCY4wNOEJ2let83
 CO4FGrA+JGa0DTp9e4zZjnG1ObxtgTVn2p5J6qwzsiczx2Bcw3GEEan254gMiDTo
 60w2+ZYYqZe8HWBBINTtUqDPHHfc1ZBIWQk8me7rJuMuH2fT8ihpoordc7YSa269
 taBtVxbQYRT3dIwf4LE7VOng+/IN6f7V6Y6aQZldR3t8cyugHYk=
 =6xu0
 -----END PGP SIGNATURE-----

Merge 1.x (1.0.69) into 2.x (master)
2024-11-09 22:26:47 -08:00
David Tolnay
41938bd3a0
Release 1.0.69 2024-11-09 22:23:49 -08:00
David Tolnay
591a44d9a3
Fix fallback fmt expression parser hang 2024-11-09 22:21:24 -08:00
David Tolnay
a17d956bd8
Clean up unneeded var 2024-11-08 14:29:08 -05:00
David Tolnay
4066d537a3
Release 2.0.1 2024-11-08 14:25:42 -05:00
David Tolnay
16f8dc1bef
Wrap interpolated variables to forward Pointer correctly 2024-11-08 13:30:06 -05:00
David Tolnay
fb59da6f7b
Resolve let_and_return clippy lint
warning: returning the result of a `let` binding from a block
      --> impl/src/fmt.rs:67:21
       |
    63 | /                     let member = match int.parse::<u32>() {
    64 | |                         Ok(index) => MemberUnraw::Unnamed(Index { index, span }),
    65 | |                         Err(_) => return Ok(()),
    66 | |                     };
       | |______________________- unnecessary `let` binding
    67 |                       member
       |                       ^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
       = note: `-W clippy::let-and-return` implied by `-W clippy::all`
       = help: to override `-W clippy::all` add `#[allow(clippy::let_and_return)]`
    help: return the expression directly
       |
    63 ~
    64 ~                     match int.parse::<u32>() {
    65 +                         Ok(index) => MemberUnraw::Unnamed(Index { index, span }),
    66 +                         Err(_) => return Ok(()),
    67 +                     }
       |
2024-11-08 13:22:56 -05:00
David Tolnay
3ee0a4dfdb
Emit rebinding only for interpolations that refer to a field 2024-11-08 13:16:55 -05:00
David Tolnay
f4d5c2a5de
Check infinite recursion as soon as Display bound is known 2024-11-08 13:16:48 -05:00
David Tolnay
8a77dea3ae
Parse trait bound before deciding name for local binding 2024-11-08 13:11:46 -05:00
David Tolnay
24e7f87d0d
Clean up formatvar identifier construction 2024-11-08 13:07:02 -05:00
David Tolnay
337df1db6d
Move recursion checking out of bindings 2024-11-08 12:58:25 -05:00
David Tolnay
5948ee6ce4
Support generic types that need multiple bounds 2024-11-08 12:48:50 -05:00
David Tolnay
1bb7e7aa78
Check invalid Named member references before producing MemberUnraw 2024-11-08 12:30:24 -05:00
David Tolnay
6097d61b58
Release 2.0.0 2024-11-05 21:50:34 -05:00
David Tolnay
d6d896df4c
Access Backtrace exclusively through ::thiserror 2024-11-05 20:58:53 -05:00
David Tolnay
2e99c515f3
Drop Provider API support in pre-1.81 nightlies 2024-11-05 19:26:35 -05:00
David Tolnay
e0e994314b
Access Error trait exclusively through ::thiserror 2024-11-05 19:22:53 -05:00
David Tolnay
2f92680b5f
Access all std types through absolute path 2024-11-05 19:15:15 -05:00
David Tolnay
fa2ba3a531
Perform imports from thiserror through absolute path 2024-11-05 19:06:32 -05:00
David Tolnay
ba9af4522e
Implement #[error(fmt = ...)] 2024-11-05 17:22:27 -05:00
David Tolnay
65f1990265
Allow error(transparent) inside an enum that has error("...") 2024-11-05 17:02:49 -05:00
David Tolnay
7a72593ee3
Delete Attrs::span in favor of just call_site() 2024-11-05 16:14:45 -05:00
David Tolnay
6cac4c078e
Set span of generated From impls 2024-11-05 00:20:02 -05:00
David Tolnay
7ca67b01f3
Let rustc generate diagnostic for colliding From impls 2024-11-05 00:19:43 -05:00
David Tolnay
b49f647299
Try joining a span for #[source] and #[from] 2024-11-05 00:14:46 -05:00
David Tolnay
5ffcf461e7
Store span of #[source] and #[from] attribute 2024-11-05 00:10:35 -05:00
David Tolnay
9d7602e226
Remove same_member in favor of MemberUnraw's PartialEq impl 2024-11-04 23:31:14 -05:00
David Tolnay
6a0eb08569
Recognize infinite recursion caused by {self} 2024-11-04 22:28:23 -05:00
David Tolnay
e44fd92065
Further deconflict macro-generated format var names with user-provided ones 2024-11-04 22:09:13 -05:00
David Tolnay
bf6efce84d
Improve diagnostic on raw identifier in format string 2024-11-04 22:05:19 -05:00
David Tolnay
58cc36e69f
Improve diagnostic on {_} in format string 2024-11-04 22:04:59 -05:00
David Tolnay
4a79e0121e
Rewrite fmt expansion to exactly preserve user-provided args 2024-11-04 22:04:18 -05:00
David Tolnay
f8fd1bf196
Fix collision of numbered field references with user-written named arg 2024-11-04 21:12:25 -05:00
David Tolnay
51ccdf18f5
Slightly cleaner implementation of has_trailing_comma 2024-11-04 20:48:22 -05:00
David Tolnay
7e43dec573
Improve error message to distinguish tuple struct vs tuple variant 2024-11-04 20:11:01 -05:00
David Tolnay
3070b8b6c8
Work around rustc pre-1.74's possibly-uninitialized checker
error[E0381]: used binding `ahead` is possibly-uninitialized
       --> impl/src/fmt.rs:187:30
        |
    182 |         let ahead;
        |             ----- binding declared here but left uninitialized
    183 |         if *syn_full.get_or_insert_with(is_syn_full) && {
    184 |             ahead = input.fork();
        |             -----
        |             |
        |             binding initialized here in some conditions
        |             binding initialized here in some conditions
    ...
    187 |             input.advance_to(&ahead);
        |                              ^^^^^^ `ahead` used here but it is possibly-uninitialized
2024-11-04 20:00:51 -05:00
David Tolnay
d3b926132b
Disable numbered access to positional args on tuples 2024-11-04 20:00:31 -05:00
David Tolnay
593317939c
Only apply inferred bounds if interpolation refers to field, not format var 2024-11-04 17:20:18 -05:00
David Tolnay
e015360076
Rename MemberUnraw::member_span() to just span() 2024-11-04 17:12:08 -05:00
David Tolnay
9116fdb8ea
Use IdentUnraw consistently when comparing Member 2024-11-04 17:12:08 -05:00
David Tolnay
78d6bd6fca
Add a type for representing raw-agnostic format vars 2024-11-04 15:52:16 -05:00
David Tolnay
6ddeda270e
Fix edge case of take_int and take_ident at end of string 2024-11-04 15:28:49 -05:00