implement debug in similar way to RangeInclusive
This commit is contained in:
parent
e8e6d9bd86
commit
d230b92ba7
6 changed files with 49 additions and 159 deletions
|
@ -688,7 +688,7 @@ impl Primitive {
|
|||
///
|
||||
/// This is intended specifically to mirror LLVM’s `!range` metadata,
|
||||
/// semantics.
|
||||
#[derive(Clone, PartialEq, Eq, Hash, Debug)]
|
||||
#[derive(Clone, PartialEq, Eq, Hash)]
|
||||
#[derive(HashStable_Generic)]
|
||||
pub struct WrappingRange {
|
||||
pub start: u128,
|
||||
|
@ -714,6 +714,13 @@ impl WrappingRange {
|
|||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for WrappingRange {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(fmt, "{}..={}", self.start, self.end)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
/// Information about one scalar component of a Rust type.
|
||||
#[derive(Clone, PartialEq, Eq, Hash, Debug)]
|
||||
#[derive(HashStable_Generic)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue