about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMartin Juarez <juarezmachadojorgemartin@gmail.com>2022-07-26 12:21:22 -0400
committerYacin Tmimi <yacintmimi@gmail.com>2022-07-26 13:06:10 -0400
commited77962d243f93e1690ac62f0b8d733383090240 (patch)
tree498473e9a5a1727c30441da6b6396aa9c56d03bb
parenta451a39dec2bd5d7f0822eaa092e1423b42ea1d3 (diff)
downloadrust-ed77962d243f93e1690ac62f0b8d733383090240.tar.gz
rust-ed77962d243f93e1690ac62f0b8d733383090240.zip
Improvements: Adding tests for the issue-4643.
-rw-r--r--tests/source/issue-4643.rs23
-rw-r--r--tests/target/issue-4643.rs19
2 files changed, 42 insertions, 0 deletions
diff --git a/tests/source/issue-4643.rs b/tests/source/issue-4643.rs
new file mode 100644
index 00000000000..382072d9004
--- /dev/null
+++ b/tests/source/issue-4643.rs
@@ -0,0 +1,23 @@
+// output doesn't get corrupted when using comments within generic type parameters of a trait
+
+pub trait Something<
+    A,
+    // some comment
+    B,
+    C
+> {
+    fn a(&self, x: A) -> i32;
+    fn b(&self, x: B) -> i32;
+    fn c(&self, x: C) -> i32;
+}
+
+pub trait SomethingElse<
+    A,
+    /* some comment */
+    B,
+    C
+> {
+    fn a(&self, x: A) -> i32;
+    fn b(&self, x: B) -> i32;
+    fn c(&self, x: C) -> i32;
+}
diff --git a/tests/target/issue-4643.rs b/tests/target/issue-4643.rs
new file mode 100644
index 00000000000..ef99e4db382
--- /dev/null
+++ b/tests/target/issue-4643.rs
@@ -0,0 +1,19 @@
+// output doesn't get corrupted when using comments within generic type parameters of a trait
+
+pub trait Something<
+    A,
+    // some comment
+    B,
+    C,
+>
+{
+    fn a(&self, x: A) -> i32;
+    fn b(&self, x: B) -> i32;
+    fn c(&self, x: C) -> i32;
+}
+
+pub trait SomethingElse<A, /* some comment */ B, C> {
+    fn a(&self, x: A) -> i32;
+    fn b(&self, x: B) -> i32;
+    fn c(&self, x: C) -> i32;
+}