diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-11-06 03:28:14 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-06 03:28:14 +0100 |
| commit | 7d66a09a29342d520a3a17ae3b4f6233c97948f4 (patch) | |
| tree | e2cc060d2dd536871c63053fa3c0839f73ff87e2 /src/libsyntax_ext | |
| parent | 76311a8db9708a016c713dcd71ec8de4153b1491 (diff) | |
| parent | bbd7f5c85b4c9f547490786a1453eaaf20dd0696 (diff) | |
| download | rust-7d66a09a29342d520a3a17ae3b4f6233c97948f4.tar.gz rust-7d66a09a29342d520a3a17ae3b4f6233c97948f4.zip | |
Rollup merge of #66093 - estebank:fmt-ice, r=Centril
Do not ICE with a precision flag in formatting str and no format arguments Fix #66065.
Diffstat (limited to 'src/libsyntax_ext')
| -rw-r--r-- | src/libsyntax_ext/format.rs | 10 |
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; } _ => {} |
