Andrew V. Teylu
cb66c85555
Preserve parentheses around Fn trait bounds in pretty printer
...
The AST pretty printer was dropping parentheses around `Fn` trait
bounds in `dyn`/`impl` types when additional `+` bounds were present.
For example:
dyn (FnMut(&mut T) -> &mut dyn ResourceLimiter) + Send + Sync
was pretty-printed as:
dyn FnMut(&mut T) -> &mut dyn ResourceLimiter + Send + Sync
Without parens, `+ Send + Sync` binds to the inner `dyn ResourceLimiter`
instead of the outer type, producing invalid Rust.
The parser already tracks parentheses via `PolyTraitRef.parens`, but
`print_poly_trait_ref` never checked this field. This adds `popen()`
and `pclose()` calls when `parens == Parens::Yes`.
Signed-off-by: Andrew V. Teylu <andrew.teylu@vector.com >
2026-03-06 10:38:47 +00:00
..
2026-01-13 08:47:48 +01:00
2025-12-12 20:34:54 +03:00
2026-01-13 08:47:48 +01:00
2026-01-13 08:47:48 +01:00
2024-02-22 16:04:04 +00:00
2025-04-03 21:41:58 +00:00
2024-02-22 16:04:04 +00:00
2024-11-27 07:18:25 -08:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:05 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2026-01-13 08:47:48 +01:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2026-01-13 08:47:48 +01:00
2025-12-23 10:34:23 +03:00
2026-03-03 02:39:40 +00:00
2025-12-25 14:49:01 +03:00
2026-02-25 08:46:47 +11:00
2025-12-25 14:49:01 +03:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2026-01-13 08:47:48 +01:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2025-04-03 21:41:58 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:05 +00:00
2024-02-22 16:04:04 +00:00
2026-01-13 08:47:48 +01:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2026-01-13 08:47:48 +01:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2026-03-03 02:39:40 +00:00
2025-04-10 14:09:37 +10:00
2026-02-12 17:43:58 +00:00
2025-03-14 06:29:24 +11:00
2026-02-22 20:20:33 +01:00
2025-11-10 14:33:56 +01:00
2026-02-12 17:43:58 +00:00
2025-04-25 14:33:14 +10:00
2026-02-12 17:43:58 +00:00
2025-03-28 08:25:06 +11:00
2026-02-12 17:43:58 +00:00
2025-02-24 14:31:19 +01:00
2026-02-12 17:43:58 +00:00
2024-02-22 16:04:04 +00:00
2026-02-12 17:43:58 +00:00
2025-03-30 11:21:51 +02:00
2025-04-03 21:41:58 +00:00
2026-01-13 08:47:48 +01:00
2025-04-25 14:33:14 +10:00
2024-02-22 16:04:04 +00:00
2026-02-12 17:43:58 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2023-01-11 09:32:08 +00:00
2026-01-13 08:47:48 +01:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:05 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2023-01-11 09:32:08 +00:00
2024-02-22 16:04:04 +00:00
2026-02-12 17:43:58 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2025-04-03 21:41:58 +00:00
2026-01-13 08:47:48 +01:00
2025-04-24 19:19:51 +10:00
2024-02-22 16:04:04 +00:00
2026-03-06 10:38:47 +00:00
2024-02-22 16:04:04 +00:00
2026-02-22 20:20:33 +01:00
2025-11-10 09:57:08 +08:00
2025-11-10 09:57:08 +08:00
2025-04-15 11:14:23 +02:00
2024-02-22 16:04:04 +00:00
2024-08-18 19:46:53 +02:00
2024-02-22 16:04:04 +00:00
2026-01-13 08:47:48 +01:00
2025-02-23 10:51:22 +01:00
2025-03-21 09:35:31 +01:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2026-01-13 08:47:48 +01:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2025-12-09 20:18:43 -08:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:05 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00