diff options
| author | Takayuki Maeda <takoyaki0316@gmail.com> | 2022-11-09 22:40:51 +0900 |
|---|---|---|
| committer | Takayuki Maeda <takoyaki0316@gmail.com> | 2022-11-15 14:28:20 +0900 |
| commit | 9857de218f10cfbe750d4c8165d960ae0da63cf4 (patch) | |
| tree | b2dfa057f8101edfc19812ed031ecb5a82495bc4 /src/test/ui/fmt | |
| parent | 0aaad9e757207657064d70bf9e6c1e6eb327bf15 (diff) | |
| download | rust-9857de218f10cfbe750d4c8165d960ae0da63cf4.tar.gz rust-9857de218f10cfbe750d4c8165d960ae0da63cf4.zip | |
shift no characters when using raw string literals
remove `find_skips` remove unnecessary variables
Diffstat (limited to 'src/test/ui/fmt')
| -rw-r--r-- | src/test/ui/fmt/format-raw-string-error.rs | 3 | ||||
| -rw-r--r-- | src/test/ui/fmt/format-raw-string-error.stderr | 10 | ||||
| -rw-r--r-- | src/test/ui/fmt/issue-104142.rs | 6 | ||||
| -rw-r--r-- | src/test/ui/fmt/issue-104142.stderr | 10 |
4 files changed, 29 insertions, 0 deletions
diff --git a/src/test/ui/fmt/format-raw-string-error.rs b/src/test/ui/fmt/format-raw-string-error.rs new file mode 100644 index 00000000000..9f0bc01a749 --- /dev/null +++ b/src/test/ui/fmt/format-raw-string-error.rs @@ -0,0 +1,3 @@ +fn main() { + println!(r#"\'\'\'\'\'\'\'\'\'\'\'\'\'\'}"#); //~ ERROR invalid format string: unmatched `}` found +} diff --git a/src/test/ui/fmt/format-raw-string-error.stderr b/src/test/ui/fmt/format-raw-string-error.stderr new file mode 100644 index 00000000000..8d61950d8c2 --- /dev/null +++ b/src/test/ui/fmt/format-raw-string-error.stderr @@ -0,0 +1,10 @@ +error: invalid format string: unmatched `}` found + --> $DIR/format-raw-string-error.rs:2:45 + | +LL | println!(r#"\'\'\'\'\'\'\'\'\'\'\'\'\'\'}"#); + | ^ unmatched `}` in format string + | + = note: if you intended to print `}`, you can escape it using `}}` + +error: aborting due to previous error + diff --git a/src/test/ui/fmt/issue-104142.rs b/src/test/ui/fmt/issue-104142.rs new file mode 100644 index 00000000000..8d7283a7197 --- /dev/null +++ b/src/test/ui/fmt/issue-104142.rs @@ -0,0 +1,6 @@ +fn main() { + println!( + r#" + \"\'}、"# //~ ERROR invalid format string: unmatched `}` found + ); +} diff --git a/src/test/ui/fmt/issue-104142.stderr b/src/test/ui/fmt/issue-104142.stderr new file mode 100644 index 00000000000..d41644faa28 --- /dev/null +++ b/src/test/ui/fmt/issue-104142.stderr @@ -0,0 +1,10 @@ +error: invalid format string: unmatched `}` found + --> $DIR/issue-104142.rs:4:9 + | +LL | \"\'}、"# + | ^ unmatched `}` in format string + | + = note: if you intended to print `}`, you can escape it using `}}` + +error: aborting due to previous error + |
