about summary refs log tree commit diff
path: root/src/libsyntax_ext
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-07-22 04:41:10 +0000
committerbors <bors@rust-lang.org>2017-07-22 04:41:10 +0000
commitf0b07cac2f4ff513dcc5f93e97f9528bfe91e622 (patch)
tree351dadeca22bcde78bd2e653d5ca48c034d7dafc /src/libsyntax_ext
parent68be86d032919e2eea1b04d5077d3e58ffaf0214 (diff)
parent5c10db3f948cefa9bd665bfc422d46a47839deab (diff)
Auto merge of #43323 - perryprog:master, r=estebank
Less verbose output for unused arguments

Closes #37718

This is my first contribution to rust, so sorry if I'm missing anything!

The output now looks like this:
<img width="831" alt="screen shot 2017-07-18 at 5 01 32 pm" src="https://user-images.githubusercontent.com/12972285/28347566-dbfa9962-6c05-11e7-8730-c2e8062a04cc.png">

It's not the prettiest, but whenever #41850 gets resolved, this should be able to be improved.

**EDIT:** This also does not seem
r? @Mark-Simulacrum
Diffstat (limited to 'src/libsyntax_ext')
-rw-r--r--src/libsyntax_ext/format.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libsyntax_ext/format.rs b/src/libsyntax_ext/format.rs
index 144d1930df9..7351377e771 100644
--- a/src/libsyntax_ext/format.rs
+++ b/src/libsyntax_ext/format.rs
@@ -798,9 +798,13 @@ pub fn expand_preparsed_format_args(ecx: &mut ExtCtxt,
             } else {
                 let mut diag = cx.ecx.struct_span_err(cx.fmtsp,
                     "multiple unused formatting arguments");
-                for (sp, msg) in errs {
-                    diag.span_note(sp, msg);
+
+                // Ignoring message, as it gets repetitive
+                // Then use MultiSpan to not clutter up errors
+                for (sp, _) in errs {
+                    diag.span_label(sp, "unused");
                 }
+
                 diag
             }
         };