Derive serde traits for TrapCode

This commit is contained in:
Artur Jamro
2019-09-24 09:28:40 -07:00
committed by Dan Gohman
parent 636ef98024
commit 1431ab5201

View File

@@ -2,11 +2,14 @@
use core::fmt::{self, Display, Formatter};
use core::str::FromStr;
#[cfg(feature = "enable-serde")]
use serde::{Deserialize, Serialize};
/// A trap code describing the reason for a trap.
///
/// All trap instructions have an explicit trap code.
#[derive(Clone, Copy, PartialEq, Eq, Debug, Hash)]
#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]
pub enum TrapCode {
/// The current stack space was exhausted.
///