Skip to content

Commit c18b6c4

Browse files
committed
Add test for tuples that should implement builtin Clone trait
1 parent 5bf5c7d commit c18b6c4

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

tests/test/tuples.rs

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,3 +134,53 @@ fn tuples_are_copy() {
134134
}
135135
}
136136
}
137+
138+
#[test]
139+
fn tuples_are_clone() {
140+
test! {
141+
program {
142+
#[lang(clone)]
143+
trait Clone { }
144+
145+
trait Foo {}
146+
147+
impl Clone for u8 {}
148+
}
149+
150+
goal {
151+
(dyn Foo,): Clone
152+
} yields {
153+
"No possible solution"
154+
}
155+
156+
goal {
157+
(u8, dyn Foo): Clone
158+
} yields {
159+
"No possible solution"
160+
}
161+
162+
goal {
163+
(dyn Foo, u8): Clone
164+
} yields {
165+
"No possible solution"
166+
}
167+
168+
goal {
169+
(): Clone
170+
} yields {
171+
"Unique; substitution [], lifetime constraints []"
172+
}
173+
174+
goal {
175+
(u8,): Clone
176+
} yields {
177+
"Unique; substitution [], lifetime constraints []"
178+
}
179+
180+
goal {
181+
(u8, u8): Clone
182+
} yields {
183+
"Unique; substitution [], lifetime constraints []"
184+
}
185+
}
186+
}

0 commit comments

Comments
 (0)