about summary refs log tree commit diff
path: root/compiler/rustc_parse_format/src/lib.rs
diff options
context:
space:
mode:
authorNilotpal Gupta <nilotpalgupta0701@gmail.com>2025-08-19 11:10:32 +0530
committerNilotpal Gupta <nilotpalgupta0701@gmail.com>2025-08-27 20:45:41 +0530
commitfdbaaac245673d8dbf7bcc21ebedc833693434f6 (patch)
treef6371ea809dd0ce3eac8f1169fb3ec184d7f5d7a /compiler/rustc_parse_format/src/lib.rs
parent269d5b56bcfdf2be82213e72ef9a2e4c592a8c6b (diff)
downloadrust-fdbaaac245673d8dbf7bcc21ebedc833693434f6.tar.gz
rust-fdbaaac245673d8dbf7bcc21ebedc833693434f6.zip
Fix format string grammar in docs and improve alignment error message
Diffstat (limited to 'compiler/rustc_parse_format/src/lib.rs')
-rw-r--r--compiler/rustc_parse_format/src/lib.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_parse_format/src/lib.rs b/compiler/rustc_parse_format/src/lib.rs
index 8e4da7923fc..5cda0b813d2 100644
--- a/compiler/rustc_parse_format/src/lib.rs
+++ b/compiler/rustc_parse_format/src/lib.rs
@@ -858,7 +858,9 @@ impl<'input> Parser<'input> {
             self.errors.insert(
                 0,
                 ParseError {
-                    description: "expected format parameter to occur after `:`".to_owned(),
+                    description:
+                        "expected alignment specifier after `:` in format string; example: `{:>?}`"
+                            .to_owned(),
                     note: None,
                     label: format!("expected `{}` to occur after `:`", alignment),
                     span: range,