about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tests/ui/resolve/suggestions/sugg-field-in-format-string-issue-141136.rs1
-rw-r--r--tests/ui/resolve/suggestions/sugg-field-in-format-string-issue-141136.stderr10
2 files changed, 10 insertions, 1 deletions
diff --git a/tests/ui/resolve/suggestions/sugg-field-in-format-string-issue-141136.rs b/tests/ui/resolve/suggestions/sugg-field-in-format-string-issue-141136.rs
index e0c2f496046..d2aa61186bc 100644
--- a/tests/ui/resolve/suggestions/sugg-field-in-format-string-issue-141136.rs
+++ b/tests/ui/resolve/suggestions/sugg-field-in-format-string-issue-141136.rs
@@ -8,6 +8,7 @@ impl Foo {
         let _ = format!("{x }"); //~ ERROR cannot find value `x` in this scope [E0425]
         let _ = format!("{ x}"); //~ ERROR invalid format string: expected `}`, found `x`
         let _ = format!("{}", x); //~ ERROR cannot find value `x` in this scope [E0425]
+        println!("{x}"); //~ ERROR cannot find value `x` in this scope [E0425]
     }
 }
 
diff --git a/tests/ui/resolve/suggestions/sugg-field-in-format-string-issue-141136.stderr b/tests/ui/resolve/suggestions/sugg-field-in-format-string-issue-141136.stderr
index 795de38d027..0a84848081d 100644
--- a/tests/ui/resolve/suggestions/sugg-field-in-format-string-issue-141136.stderr
+++ b/tests/ui/resolve/suggestions/sugg-field-in-format-string-issue-141136.stderr
@@ -35,6 +35,14 @@ help: you might have meant to use the available field
 LL |         let _ = format!("{}", self.x);
    |                               +++++
 
-error: aborting due to 4 previous errors
+error[E0425]: cannot find value `x` in this scope
+  --> $DIR/sugg-field-in-format-string-issue-141136.rs:11:20
+   |
+LL |         println!("{x}");
+   |                    ^
+   |
+   = help: you might have meant to use the available field in a format string: `"{}", self.x`
+
+error: aborting due to 5 previous errors
 
 For more information about this error, try `rustc --explain E0425`.