]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/const_eval.rs
rustc: use DefKind instead of Def, where possible.
[rust.git] / src / librustc_mir / const_eval.rs
index f4c7b40647c7bbdb70166104aac63d6d9eb45964..866b6492d10bcbfa85cc85f6fe6f3405c11d0988 100644 (file)
@@ -6,7 +6,7 @@
 use std::hash::Hash;
 use std::collections::hash_map::Entry;
 
-use rustc::hir::def::{Def, DefKind};
+use rustc::hir::def::DefKind;
 use rustc::hir::def_id::DefId;
 use rustc::mir::interpret::{ConstEvalErr, ErrorHandled};
 use rustc::mir;
@@ -634,14 +634,14 @@ pub fn const_eval_raw_provider<'a, 'tcx>(
             }
         } else if def_id.is_local() {
             // constant defined in this crate, we can figure out a lint level!
-            match tcx.describe_def(def_id) {
+            match tcx.def_kind(def_id) {
                 // constants never produce a hard error at the definition site. Anything else is
                 // a backwards compatibility hazard (and will break old versions of winapi for sure)
                 //
                 // note that validation may still cause a hard error on this very same constant,
                 // because any code that existed before validation could not have failed validation
                 // thus preventing such a hard error from being a backwards compatibility hazard
-                Some(Def::Def(DefKind::Const, _)) | Some(Def::Def(DefKind::AssociatedConst, _)) => {
+                Some(DefKind::Const) | Some(DefKind::AssociatedConst) => {
                     let hir_id = tcx.hir().as_local_hir_id(def_id).unwrap();
                     err.report_as_lint(
                         tcx.at(tcx.def_span(def_id)),