Remove DEP_KIND_DEBUG.
It's plumbing to work around lack of access to `rustc_middle`, which is no longer a problem.
This commit is contained in:
parent
8d56cfe4c3
commit
74dd36a934
2 changed files with 9 additions and 25 deletions
|
|
@ -69,7 +69,7 @@ use rustc_span::Symbol;
|
|||
|
||||
use super::{FingerprintStyle, SerializedDepNodeIndex};
|
||||
use crate::mir::mono::MonoItem;
|
||||
use crate::ty::TyCtxt;
|
||||
use crate::ty::{TyCtxt, tls};
|
||||
|
||||
/// This serves as an index into arrays built by `make_dep_kind_array`.
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
|
||||
|
|
@ -114,16 +114,15 @@ impl DepKind {
|
|||
pub(crate) const MAX: u16 = DEP_KIND_VARIANTS - 1;
|
||||
}
|
||||
|
||||
pub fn default_dep_kind_debug(kind: DepKind, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("DepKind").field("variant", &kind.variant).finish()
|
||||
}
|
||||
|
||||
pub static DEP_KIND_DEBUG: AtomicRef<fn(DepKind, &mut fmt::Formatter<'_>) -> fmt::Result> =
|
||||
AtomicRef::new(&(default_dep_kind_debug as fn(_, &mut fmt::Formatter<'_>) -> _));
|
||||
|
||||
impl fmt::Debug for DepKind {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
(*DEP_KIND_DEBUG)(*self, f)
|
||||
tls::with_opt(|opt_tcx| {
|
||||
if let Some(tcx) = opt_tcx {
|
||||
write!(f, "{}", tcx.dep_kind_vtable(*self).name)
|
||||
} else {
|
||||
f.debug_struct("DepKind").field("variant", &self.variant).finish()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue