Ty Debug now prints id and kind
This commit is contained in:
parent
24bece8420
commit
cc7c5ad20b
1 changed files with 8 additions and 1 deletions
|
@ -1,9 +1,16 @@
|
||||||
use super::{mir::Mutability, mir::Safety, with, AllocId, DefId};
|
use super::{mir::Mutability, mir::Safety, with, AllocId, DefId};
|
||||||
use crate::rustc_internal::Opaque;
|
use crate::rustc_internal::Opaque;
|
||||||
|
use std::fmt::{self, Debug, Formatter};
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct Ty(pub usize);
|
pub struct Ty(pub usize);
|
||||||
|
|
||||||
|
impl Debug for Ty {
|
||||||
|
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
|
||||||
|
f.debug_struct("Ty").field("id", &self.0).field("kind", &self.kind()).finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Ty {
|
impl Ty {
|
||||||
pub fn kind(&self) -> TyKind {
|
pub fn kind(&self) -> TyKind {
|
||||||
with(|context| context.ty_kind(*self))
|
with(|context| context.ty_kind(*self))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue