Files
rust/library/alloc/src
Matthias Krüger e5f96e3b43 Rollup merge of #145592 - nilotpal-n7:fix-format-alignment, r=lcnr
Fix format string grammar in docs and improve alignment error message for #144023

This PR improves error messages and documentation for format strings involving alignment and formatting traits.

Highlights:

- Clearer error messages for invalid alignment specifiers (e.g., `{0:#X>18}`), showing the expected `<`, `^`, or `>` and a working example:

    println!("{0:>#18X}", value);

- Updated UI test `format-alignment-hash.rs` to reflect the improved error output.
- Documentation clarification: ensures examples correctly show how width, alignment, and traits like `x`, `X`, `#` combine.

Motivation:
Previously, using `#` with alignment and width produced confusing errors. This PR guides users on the correct syntax and provides actionable examples.

Testing:
- Built the compiler (`./x build`)
- Blessed and ran UI tests (`./x. test src/test/ui/fmt/format-alignment-hash.rs --bless`)
- Verified full test suite passes (`./x test`)

Issue: rust-lang/rust#144023
2025-08-31 13:40:35 +02:00
..
2025-08-26 22:58:44 +02:00
2025-08-20 20:31:33 -04:00
2025-08-20 17:08:46 +01:00
2025-08-20 20:31:33 -04:00
2025-04-28 06:56:13 +10:00
2025-07-27 23:03:07 -07:00
2025-06-06 06:39:51 +02:00
2024-12-05 14:14:17 -08:00