1
Fork 0

Add #[cfg(panic = "...")]

This commit is contained in:
David Hewitt 2020-07-25 19:02:49 +01:00
parent 25f6938da4
commit 8d43b3cbb9
15 changed files with 136 additions and 10 deletions

View file

@ -37,6 +37,7 @@
use crate::spec::abi::{lookup as lookup_abi, Abi};
use crate::spec::crt_objects::{CrtObjects, CrtObjectsFallback};
use rustc_serialize::json::{Json, ToJson};
use rustc_span::symbol::{sym, Symbol};
use std::collections::BTreeMap;
use std::ops::Deref;
use std::path::{Path, PathBuf};
@ -176,6 +177,13 @@ impl PanicStrategy {
PanicStrategy::Abort => "abort",
}
}
pub fn desc_symbol(&self) -> Symbol {
match *self {
PanicStrategy::Unwind => sym::unwind,
PanicStrategy::Abort => sym::abort,
}
}
}
impl ToJson for PanicStrategy {