diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2018-08-22 17:45:34 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-22 17:45:34 +0200 |
| commit | 4fa4bb56339868a125c2f5a80a1cea982d92d545 (patch) | |
| tree | a031de63ea6d04b05e36a01eb99057444a4a8f23 /src/libsyntax_ext | |
| parent | 55d98236f9fcdf88f574bcf8180c0e92924d616c (diff) | |
| parent | 5a23a0d283653c79fd623b479b1e8e71d5eea093 (diff) | |
| download | rust-4fa4bb56339868a125c2f5a80a1cea982d92d545.tar.gz rust-4fa4bb56339868a125c2f5a80a1cea982d92d545.zip | |
Rollup merge of #53504 - ekse:suggestions-applicability-2, r=estebank
Set applicability for more suggestions. Converts a couple more calls to `span_suggestion_with_applicability` (#50723). To be on the safe side, I marked suggestions that depend on the intent of the user or that are potentially lossy conversions as MaybeIncorrect. r? @estebank
Diffstat (limited to 'src/libsyntax_ext')
| -rw-r--r-- | src/libsyntax_ext/format.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libsyntax_ext/format.rs b/src/libsyntax_ext/format.rs index bebf20b1a38..b23c2ec3db1 100644 --- a/src/libsyntax_ext/format.rs +++ b/src/libsyntax_ext/format.rs @@ -22,6 +22,7 @@ use syntax::ptr::P; use syntax::symbol::Symbol; use syntax::tokenstream; use syntax_pos::{MultiSpan, Span, DUMMY_SP}; +use errors::Applicability; use std::borrow::Cow; use std::collections::hash_map::Entry; @@ -791,10 +792,11 @@ pub fn expand_preparsed_format_args(ecx: &mut ExtCtxt, 0 => "{}".to_string(), _ => format!("{}{{}}", "{} ".repeat(args.len())), }; - err.span_suggestion( + err.span_suggestion_with_applicability( fmt_sp.shrink_to_lo(), "you might be missing a string literal to format with", format!("\"{}\", ", sugg_fmt), + Applicability::MaybeIncorrect, ); err.emit(); return DummyResult::raw_expr(sp); |
