diff options
| author | Esteban Küber <esteban@commure.com> | 2018-07-21 12:16:06 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@commure.com> | 2018-07-21 12:16:06 -0700 |
| commit | 83a8af50bbf704b5cdf2cbbab481e0e936ed03a8 (patch) | |
| tree | 99ccfe0a139a99f65d09dacee1f98f13b69e58e1 | |
| parent | 8b59fbc951dabc714ff882674db01e58d44db98b (diff) | |
| download | rust-83a8af50bbf704b5cdf2cbbab481e0e936ed03a8.tar.gz rust-83a8af50bbf704b5cdf2cbbab481e0e936ed03a8.zip | |
Suggest space separated format str literal
| -rw-r--r-- | src/libsyntax_ext/format.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/macros/bad_hello.stderr | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax_ext/format.rs b/src/libsyntax_ext/format.rs index 7acfb08020f..9f153c36733 100644 --- a/src/libsyntax_ext/format.rs +++ b/src/libsyntax_ext/format.rs @@ -728,7 +728,7 @@ pub fn expand_preparsed_format_args(ecx: &mut ExtCtxt, Err(mut err) => { let sugg_fmt = match args.len() { 0 => "{}".to_string(), - _ => format!("{}{{}}", "{}, ".repeat(args.len())), + _ => format!("{}{{}}", "{} ".repeat(args.len())), }; err.span_suggestion( diff --git a/src/test/ui/macros/bad_hello.stderr b/src/test/ui/macros/bad_hello.stderr index 87ea515182f..c675eede215 100644 --- a/src/test/ui/macros/bad_hello.stderr +++ b/src/test/ui/macros/bad_hello.stderr @@ -15,8 +15,8 @@ LL | println!(3, 4); | ^ help: you might be missing a string literal to format with | -LL | println!("{}, {}", 3, 4); - | ^^^^^^^^^ +LL | println!("{} {}", 3, 4); + | ^^^^^^^^ error: aborting due to 2 previous errors |
