Skip to content

Commit 5ec7067

Browse files
stepanchegvmagro
authored andcommitted
[antlir] Migrate for changes in starlark
Summary: New starlark requires `derive(Allocative)`. Test Plan: CI Reviewed By: vmagro Differential Revision: D41146922 fbshipit-source-id: 14f715f71fe2943e81ffa63994489af2efb596c6
1 parent 9a14898 commit 5ec7067

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

antlir/bzl/shape2/BUCK

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ antlir_tool(
2222
test_deps = ["maplit"],
2323
visibility = ["PUBLIC"],
2424
deps = [
25+
"allocative",
2526
"anyhow",
2627
"derive_more",
2728
"gazebo",

antlir/bzl/shape2/bzl2ir.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use std::collections::BTreeMap;
1111
use std::path::PathBuf;
1212
use std::sync::Arc;
1313

14+
use allocative::Allocative;
1415
use anyhow::anyhow;
1516
use anyhow::bail;
1617
use anyhow::ensure;
@@ -74,7 +75,8 @@ fn eval_and_freeze_module(
7475
slotmap::new_key_type! {
7576
/// TypeId and TypeRegistry exist to store unique references to complex types.
7677
/// These are types that end up getting codegenned, not primitives.
77-
#[derive(ProvidesStaticType, NoSerialize)]
78+
#[derive(ProvidesStaticType, NoSerialize, Allocative)]
79+
#[allocative(skip)]
7880
struct TypeId;
7981
}
8082
impl std::fmt::Display for TypeId {
@@ -103,9 +105,10 @@ impl TypeRegistry {
103105
}
104106
}
105107

106-
#[derive(Debug, Clone, Display, ProvidesStaticType, NoSerialize)]
108+
#[derive(Debug, Clone, Display, ProvidesStaticType, NoSerialize, Allocative)]
107109
#[display(fmt = "{:?}", self)]
108110
#[repr(transparent)]
111+
#[allocative(skip)]
109112
struct StarlarkType(Arc<ir::Type>);
110113
starlark_simple_value!(StarlarkType);
111114
impl<'v> StarlarkValue<'v> for StarlarkType {
@@ -156,9 +159,10 @@ impl<'v> TryToField for Value<'v> {
156159
}
157160
}
158161

159-
#[derive(Debug, Clone, Display, ProvidesStaticType, NoSerialize)]
162+
#[derive(Debug, Clone, Display, ProvidesStaticType, NoSerialize, Allocative)]
160163
#[display(fmt = "{:?}", self)]
161164
#[repr(transparent)]
165+
#[allocative(skip)]
162166
struct StarlarkField(ir::Field);
163167
starlark_simple_value!(StarlarkField);
164168
impl<'v> StarlarkValue<'v> for StarlarkField {

0 commit comments

Comments
 (0)