diff options
Diffstat (limited to 'compiler/rustc_target/src/json.rs')
| -rw-r--r-- | compiler/rustc_target/src/json.rs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/compiler/rustc_target/src/json.rs b/compiler/rustc_target/src/json.rs index f3aecaaab98..9436e34d380 100644 --- a/compiler/rustc_target/src/json.rs +++ b/compiler/rustc_target/src/json.rs @@ -2,7 +2,9 @@ use std::borrow::Cow; use std::collections::BTreeMap; pub use serde_json::Value as Json; -use serde_json::{Map, Number}; +use serde_json::{json, Map, Number}; + +use crate::spec::TargetMetadata; pub trait ToJson { fn to_json(&self) -> Json; @@ -120,3 +122,14 @@ impl ToJson for crate::abi::call::Conv { Json::String(s.to_owned()) } } + +impl ToJson for TargetMetadata { + fn to_json(&self) -> Json { + json!({ + "description": self.description, + "tier": self.tier, + "host_tools": self.host_tools, + "std": self.std, + }) + } +} |
