about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-09-26 10:05:49 +0000
committerbors <bors@rust-lang.org>2020-09-26 10:05:49 +0000
commit6f9a8a7f9b9732c55511d2a2a3914e8feafc7c52 (patch)
treed77a885e5e2b10747a35ac8aeb439f0f080a5674 /src/test
parentfd15e6180d9c48b4f1157e44cdaff6e901e5f854 (diff)
parent2ac89ff994c9ddcc49eed2b06ff5327bc09f4118 (diff)
downloadrust-6f9a8a7f9b9732c55511d2a2a3914e8feafc7c52.tar.gz
rust-6f9a8a7f9b9732c55511d2a2a3914e8feafc7c52.zip
Auto merge of #76485 - estebank:format_arg_capture_spans, r=davidtwco
Point at named argument not found when using `format_args_capture` instead of whole format string
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/fmt/format-args-capture-missing-variables.rs6
-rw-r--r--src/test/ui/fmt/format-args-capture-missing-variables.stderr31
2 files changed, 16 insertions, 21 deletions
diff --git a/src/test/ui/fmt/format-args-capture-missing-variables.rs b/src/test/ui/fmt/format-args-capture-missing-variables.rs
index 3c596ae3bb8..3a4b6144b04 100644
--- a/src/test/ui/fmt/format-args-capture-missing-variables.rs
+++ b/src/test/ui/fmt/format-args-capture-missing-variables.rs
@@ -5,7 +5,7 @@ fn main() {
     //~^ ERROR: cannot find value `foo` in this scope
     //~^^ ERROR: cannot find value `bar` in this scope
 
-    format!("{foo}");                //~ ERROR: cannot find value `foo` in this scope
+    format!("{foo}"); //~ ERROR: cannot find value `foo` in this scope
 
     format!("{valuea} {valueb}", valuea=5, valuec=7);
     //~^ ERROR cannot find value `valueb` in this scope
@@ -16,7 +16,7 @@ fn main() {
         {foo}
 
     "##);
-    //~^^^^^ ERROR: cannot find value `foo` in this scope
+    //~^^^ ERROR: cannot find value `foo` in this scope
 
-    panic!("{foo} {bar}", bar=1);    //~ ERROR: cannot find value `foo` in this scope
+    panic!("{foo} {bar}", bar=1); //~ ERROR: cannot find value `foo` in this scope
 }
diff --git a/src/test/ui/fmt/format-args-capture-missing-variables.stderr b/src/test/ui/fmt/format-args-capture-missing-variables.stderr
index c3d740eef9d..ec2faa4185b 100644
--- a/src/test/ui/fmt/format-args-capture-missing-variables.stderr
+++ b/src/test/ui/fmt/format-args-capture-missing-variables.stderr
@@ -7,45 +7,40 @@ LL |     format!("{valuea} {valueb}", valuea=5, valuec=7);
    |             formatting specifier missing
 
 error[E0425]: cannot find value `foo` in this scope
-  --> $DIR/format-args-capture-missing-variables.rs:4:13
+  --> $DIR/format-args-capture-missing-variables.rs:4:17
    |
 LL |     format!("{} {foo} {} {bar} {}", 1, 2, 3);
-   |             ^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
+   |                 ^^^^^ not found in this scope
 
 error[E0425]: cannot find value `bar` in this scope
-  --> $DIR/format-args-capture-missing-variables.rs:4:13
+  --> $DIR/format-args-capture-missing-variables.rs:4:26
    |
 LL |     format!("{} {foo} {} {bar} {}", 1, 2, 3);
-   |             ^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
+   |                          ^^^^^ not found in this scope
 
 error[E0425]: cannot find value `foo` in this scope
-  --> $DIR/format-args-capture-missing-variables.rs:8:13
+  --> $DIR/format-args-capture-missing-variables.rs:8:14
    |
 LL |     format!("{foo}");
-   |             ^^^^^^^ not found in this scope
+   |              ^^^^^ not found in this scope
 
 error[E0425]: cannot find value `valueb` in this scope
-  --> $DIR/format-args-capture-missing-variables.rs:10:13
+  --> $DIR/format-args-capture-missing-variables.rs:10:23
    |
 LL |     format!("{valuea} {valueb}", valuea=5, valuec=7);
-   |             ^^^^^^^^^^^^^^^^^^^ not found in this scope
+   |                       ^^^^^^^^ not found in this scope
 
 error[E0425]: cannot find value `foo` in this scope
-  --> $DIR/format-args-capture-missing-variables.rs:14:13
+  --> $DIR/format-args-capture-missing-variables.rs:16:9
    |
-LL |       format!(r##"
-   |  _____________^
-LL | |
-LL | |         {foo}
-LL | |
-LL | |     "##);
-   | |_______^ not found in this scope
+LL |         {foo}
+   |         ^^^^^ not found in this scope
 
 error[E0425]: cannot find value `foo` in this scope
-  --> $DIR/format-args-capture-missing-variables.rs:21:12
+  --> $DIR/format-args-capture-missing-variables.rs:21:13
    |
 LL |     panic!("{foo} {bar}", bar=1);
-   |            ^^^^^^^^^^^^^ not found in this scope
+   |             ^^^^^ not found in this scope
 
 error: aborting due to 7 previous errors