compiler: Move impl of ToJson for abi::Endian

This commit is contained in:
Jubilee Young 2024-10-08 19:07:43 -07:00
parent 1bc403daad
commit 559de74562
2 changed files with 6 additions and 8 deletions

View File

@ -6,19 +6,11 @@ use Primitive::*;
use rustc_data_structures::intern::Interned;
use rustc_macros::HashStable_Generic;
use crate::json::{Json, ToJson};
pub mod call;
// Explicitly import `Float` to avoid ambiguity with `Primitive::Float`.
pub use rustc_abi::{Float, *};
impl ToJson for Endian {
fn to_json(&self) -> Json {
self.as_str().to_json()
}
}
rustc_index::newtype_index! {
/// The *source-order* index of a field in a variant.
///

View File

@ -134,3 +134,9 @@ impl ToJson for TargetMetadata {
})
}
}
impl ToJson for rustc_abi::Endian {
fn to_json(&self) -> Json {
self.as_str().to_json()
}
}