From ab7de1c10e61af9a5f667770215781eb7d04c0d2 Mon Sep 17 00:00:00 2001 From: Jakob Degen Date: Fri, 26 Jan 2024 14:21:25 -0800 Subject: [PATCH] allocative: `impl Allocative for TypeId` Summary: Need it next diff Reviewed By: dtolnay Differential Revision: D53114425 fbshipit-source-id: 6fbeb107e46c4247b1bb44451fb20c0f3dc7be67 --- allocative/allocative/src/impls/std/any.rs | 17 +++++++++++++++++ allocative/allocative/src/impls/std/mod.rs | 1 + 2 files changed, 18 insertions(+) create mode 100644 allocative/allocative/src/impls/std/any.rs diff --git a/allocative/allocative/src/impls/std/any.rs b/allocative/allocative/src/impls/std/any.rs new file mode 100644 index 000000000..1e67f46ee --- /dev/null +++ b/allocative/allocative/src/impls/std/any.rs @@ -0,0 +1,17 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under both the MIT license found in the + * LICENSE-MIT file in the root directory of this source tree and the Apache + * License, Version 2.0 found in the LICENSE-APACHE file in the root directory + * of this source tree. + */ + +use crate::allocative_trait::Allocative; +use crate::visitor::Visitor; + +impl Allocative for std::any::TypeId { + fn visit<'a, 'b: 'a>(&self, visitor: &'a mut Visitor<'b>) { + visitor.visit_simple_sized::(); + } +} diff --git a/allocative/allocative/src/impls/std/mod.rs b/allocative/allocative/src/impls/std/mod.rs index 65f5b4edc..49e07bb62 100644 --- a/allocative/allocative/src/impls/std/mod.rs +++ b/allocative/allocative/src/impls/std/mod.rs @@ -7,6 +7,7 @@ * of this source tree. */ +mod any; mod cell; mod collections; mod function;