mirror of https://github.com/rust-lang/rust.git
Ty Debug now prints id and kind
This commit is contained in:
parent
24bece8420
commit
cc7c5ad20b
|
@ -1,9 +1,16 @@
|
|||
use super::{mir::Mutability, mir::Safety, with, AllocId, DefId};
|
||||
use crate::rustc_internal::Opaque;
|
||||
use std::fmt::{self, Debug, Formatter};
|
||||
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
#[derive(Copy, Clone)]
|
||||
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 {
|
||||
pub fn kind(&self) -> TyKind {
|
||||
with(|context| context.ty_kind(*self))
|
||||
|
|
Loading…
Reference in New Issue