Skip to content

Commit bde2be0

Browse files
committed
Add test for raw string
1 parent c55a698 commit bde2be0

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/test/ui/ifmt-bad-arg.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,11 @@ fn main() {
6464
format!("foo }"); //~ ERROR: unmatched `}` found
6565

6666
format!("foo %s baz", "bar"); //~ ERROR: argument never used
67+
68+
format!(r##"
69+
70+
{foo}
71+
72+
"##);
73+
//~^^^ ERROR: there is no argument named `foo`
6774
}

src/test/ui/ifmt-bad-arg.stderr

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,5 +183,11 @@ LL | format!("foo %s baz", "bar"); //~ ERROR: argument never used
183183
= help: `%s` should be written as `{}`
184184
= note: printf formatting not supported; see the documentation for `std::fmt`
185185

186-
error: aborting due to 26 previous errors
186+
error: there is no argument named `foo`
187+
--> $DIR/ifmt-bad-arg.rs:70:9
188+
|
189+
LL | {foo}
190+
| ^^^^^
191+
192+
error: aborting due to 27 previous errors
187193

0 commit comments

Comments
 (0)