Skip to content
Closed
Changes from 2 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion compiler/rustc_smir/src/stable_mir/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@ use super::{
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))
Expand Down