]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-35546.rs
Auto merge of #57108 - Mark-Simulacrum:license-remove, r=pietroalbini
[rust.git] / src / test / ui / issues / issue-35546.rs
1 // compile-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<Send>>>,
10     value: T,
11 }
12
13 fn clear(head: &mut Option<Box<Node<Send>>>) {
14     match head.take() {
15         Some(node) => *head = node.next,
16         None => (),
17     }
18 }
19
20 fn main() {}