Skip to content

Commit

Permalink
Unimpl Serialize for AValueImpl and BlackHole
Browse files Browse the repository at this point in the history
Summary: Some old dead code.

Reviewed By: ndmitchell

Differential Revision: D56378816

fbshipit-source-id: 46b9c9eae1aff0642e7401a94a05f3c89ac1b593
  • Loading branch information
stepancheg authored and facebook-github-bot committed Apr 20, 2024
1 parent 293532e commit d1cbf9b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
20 changes: 0 additions & 20 deletions starlark/src/values/layout/avalue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ use std::mem;

use allocative::Allocative;
use derive_more::Display;
use serde::Serialize;
use serde::Serializer;
use starlark_syntax::slice_vec_ext::SliceExt;

use crate as starlark;
Expand Down Expand Up @@ -686,24 +684,6 @@ where
#[display(fmt = "BlackHole")]
pub(crate) struct BlackHole(pub(crate) ValueAllocSize);

impl Serialize for BlackHole {
fn serialize<S>(&self, _s: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
panic!()
}
}

impl<'v, Mode: AValueMode, T: StarlarkValue<'v>> Serialize for AValueImpl<Mode, T> {
fn serialize<S>(&self, s: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
erased_serde::serialize(&self.1, s)
}
}

#[cfg(test)]
mod tests {
use crate::environment::Module;
Expand Down
5 changes: 1 addition & 4 deletions starlark/src/values/layout/vtable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,7 @@ impl AValueVTable {
let this = unsafe { &*this.value_ptr::<BlackHole>() };
this as *const dyn Debug
},
erased_serde_serialize: |this| {
let this = unsafe { &*this.value_ptr::<BlackHole>() };
this as *const dyn erased_serde::Serialize
},
erased_serde_serialize: |_this| unreachable!(),
allocative: |this| {
let this = unsafe { &*this.value_ptr::<BlackHole>() };
this as *const dyn Allocative
Expand Down

0 comments on commit d1cbf9b

Please sign in to comment.