]> git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-35546.rs
New upstream version 1.38.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-35546.rs
1 // build-pass (FIXME(62277): could be check-pass?)
2 #![allow(dead_code)]
3 // Regression test for #35546. Check that we are able to codegen
4 // this. Before we had problems because of the drop glue signature
5 // around dropping a trait object (specifically, when dropping the
6 // `value` field of `Node<Send>`).
7
8 struct Node<T: ?Sized + Send> {
9 next: Option<Box<Node<dyn Send>>>,
10 value: T,
11 }
12
13 fn clear(head: &mut Option<Box<Node<dyn Send>>>) {
14 match head.take() {
15 Some(node) => *head = node.next,
16 None => (),
17 }
18 }
19
20 fn main() {}