Files
rust/tests/pretty
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
2024-02-22 16:04:05 +00:00
2025-04-03 21:41:58 +00:00
2024-02-22 16:04:05 +00:00
2026-02-22 20:20:33 +01:00
2025-02-24 14:31:19 +01:00
2025-04-03 21:41:58 +00:00
2023-01-11 09:32:08 +00:00
2024-02-22 16:04:05 +00:00
2023-01-11 09:32:08 +00:00
2026-02-22 20:20:33 +01:00
2025-04-15 11:14:23 +02:00
2024-08-18 19:46:53 +02:00
2025-03-21 09:35:31 +01:00
2024-02-22 16:04:05 +00:00