allocative/impls/std/mem.rs
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under both the MIT license found in the
5 * LICENSE-MIT file in the root directory of this source tree and the Apache
6 * License, Version 2.0 found in the LICENSE-APACHE file in the root directory
7 * of this source tree.
8 */
9
10use std::mem::ManuallyDrop;
11
12use crate::Allocative;
13use crate::Key;
14use crate::Visitor;
15
16impl<T: Allocative + ?Sized> Allocative for ManuallyDrop<T> {
17 fn visit<'a, 'b: 'a>(&self, visitor: &'a mut Visitor<'b>) {
18 let mut visitor = visitor.enter_self(self);
19 visitor.visit_field::<T>(Key::new("inner"), self);
20 visitor.exit();
21 }
22}