diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
commit | 698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch) | |
tree | 173a775858bd501c378080a10dca74132f05bc50 /src/tools/rustfmt/tests/target/issue-1210 | |
parent | Initial commit. (diff) | |
download | rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip |
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/rustfmt/tests/target/issue-1210')
-rw-r--r-- | src/tools/rustfmt/tests/target/issue-1210/a.rs | 16 | ||||
-rw-r--r-- | src/tools/rustfmt/tests/target/issue-1210/b.rs | 16 | ||||
-rw-r--r-- | src/tools/rustfmt/tests/target/issue-1210/c.rs | 7 | ||||
-rw-r--r-- | src/tools/rustfmt/tests/target/issue-1210/d.rs | 4 | ||||
-rw-r--r-- | src/tools/rustfmt/tests/target/issue-1210/e.rs | 11 |
5 files changed, 54 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/target/issue-1210/a.rs b/src/tools/rustfmt/tests/target/issue-1210/a.rs new file mode 100644 index 000000000..94c1b44e5 --- /dev/null +++ b/src/tools/rustfmt/tests/target/issue-1210/a.rs @@ -0,0 +1,16 @@ +// rustfmt-format_strings: true +// rustfmt-max_width: 50 + +impl Foo { + fn cxx(&self, target: &str) -> &Path { + match self.cxx.get(target) { + Some(p) => p.path(), + None => panic!( + "\n\ntarget `{}` is not \ + configured as a host, + only as a target\n\n", + target + ), + } + } +} diff --git a/src/tools/rustfmt/tests/target/issue-1210/b.rs b/src/tools/rustfmt/tests/target/issue-1210/b.rs new file mode 100644 index 000000000..a7b1e3bcd --- /dev/null +++ b/src/tools/rustfmt/tests/target/issue-1210/b.rs @@ -0,0 +1,16 @@ +// rustfmt-format_strings: true +// rustfmt-max_width: 50 + +impl Foo { + fn cxx(&self, target: &str) -> &Path { + match self.cxx.get(target) { + Some(p) => p.path(), + None => panic!( + "\ntarget `{}`: is not, \ + configured as a host, + only as a target\n\n", + target + ), + } + } +} diff --git a/src/tools/rustfmt/tests/target/issue-1210/c.rs b/src/tools/rustfmt/tests/target/issue-1210/c.rs new file mode 100644 index 000000000..183d79f92 --- /dev/null +++ b/src/tools/rustfmt/tests/target/issue-1210/c.rs @@ -0,0 +1,7 @@ +// rustfmt-format_strings: true +// rustfmt-max_width: 50 + +const foo: String = + "trailing_spaces!! + keep them! Amet neque. Praesent \ + rhoncus eros non velit."; diff --git a/src/tools/rustfmt/tests/target/issue-1210/d.rs b/src/tools/rustfmt/tests/target/issue-1210/d.rs new file mode 100644 index 000000000..9279e6fc9 --- /dev/null +++ b/src/tools/rustfmt/tests/target/issue-1210/d.rs @@ -0,0 +1,4 @@ +// rustfmt-wrap_comments: true + +// trailing_spaces_in_comment!! +// remove those from above diff --git a/src/tools/rustfmt/tests/target/issue-1210/e.rs b/src/tools/rustfmt/tests/target/issue-1210/e.rs new file mode 100644 index 000000000..55f80c6c3 --- /dev/null +++ b/src/tools/rustfmt/tests/target/issue-1210/e.rs @@ -0,0 +1,11 @@ +// rustfmt-format_strings: true +// rustfmt-max_width: 50 + +// explicit line breaks should be kept in order to preserve the layout + +const foo: String = + "Suspendisse vel augue at felis tincidunt \ + sollicitudin. Fusce arcu. + Duis et odio et leo + sollicitudin consequat. Aliquam \ + lobortis. Phasellus condimentum."; |