use crate::hir;
-use crate::hir::def::{Namespace, Def};
+use crate::hir::def::{Namespace, DefKind};
use crate::hir::map::{DefPathData, DisambiguatedDefPathData};
use crate::hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX, LOCAL_CRATE};
use crate::middle::cstore::{ExternCrate, ExternCrateSource};
return Ok(self);
}
if let ConstValue::Unevaluated(did, substs) = ct.val {
- match self.tcx().describe_def(did) {
- | Some(Def::Static(_))
- | Some(Def::Const(_))
- | Some(Def::AssociatedConst(_)) => p!(print_value_path(did, substs)),
+ match self.tcx().def_kind(did) {
+ | Some(DefKind::Static)
+ | Some(DefKind::Const)
+ | Some(DefKind::AssociatedConst) => p!(print_value_path(did, substs)),
_ => if did.is_local() {
let span = self.tcx().def_span(did);
if let Ok(snip) = self.tcx().sess.source_map().span_to_snippet(span) {
// as well as the unprintable types of constants (see `push_type_name` for more details).
pub fn push_const_name(&self, c: &Const<'tcx>, output: &mut String, debug: bool) {
match c.val {
- ConstValue::Scalar(..) | ConstValue::Slice(..) | ConstValue::ByRef(..) => {
+ ConstValue::Scalar(..) | ConstValue::Slice { .. } | ConstValue::ByRef(..) => {
// FIXME(const_generics): we could probably do a better job here.
write!(output, "{:?}", c).unwrap()
}