2019-10-28 19:00:00 -05:00
|
|
|
// build-pass
|
2018-09-25 16:51:35 -05:00
|
|
|
#![allow(dead_code)]
|
2016-09-13 17:33:35 -05:00
|
|
|
// Regression test for #35546. Check that we are able to codegen
|
|
|
|
// this. Before we had problems because of the drop glue signature
|
|
|
|
// around dropping a trait object (specifically, when dropping the
|
|
|
|
// `value` field of `Node<Send>`).
|
|
|
|
|
|
|
|
struct Node<T: ?Sized + Send> {
|
2019-05-28 13:46:13 -05:00
|
|
|
next: Option<Box<Node<dyn Send>>>,
|
2016-09-13 17:33:35 -05:00
|
|
|
value: T,
|
|
|
|
}
|
|
|
|
|
2019-05-28 13:46:13 -05:00
|
|
|
fn clear(head: &mut Option<Box<Node<dyn Send>>>) {
|
2016-09-13 17:33:35 -05:00
|
|
|
match head.take() {
|
|
|
|
Some(node) => *head = node.next,
|
|
|
|
None => (),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|