about summary refs log tree commit diff
path: root/src/libsyntax_ext/format.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsyntax_ext/format.rs')
-rw-r--r--src/libsyntax_ext/format.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libsyntax_ext/format.rs b/src/libsyntax_ext/format.rs
index 37310f46f7e..3c7f80aa399 100644
--- a/src/libsyntax_ext/format.rs
+++ b/src/libsyntax_ext/format.rs
@@ -374,10 +374,12 @@ impl<'a, 'b> Context<'a, 'b> {
                                 format!("are {} arguments", count)
                             },
                         ));
-                        e.span_label(
-                            self.args[pos].span,
-                            "this parameter corresponds to the precision flag",
-                        );
+                        if let Some(arg) = self.args.get(pos) {
+                            e.span_label(
+                                arg.span,
+                                "this parameter corresponds to the precision flag",
+                            );
+                        }
                         zero_based_note = true;
                     }
                     _ => {}