]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_mir/transform/const_prop.rs
rustc: use DefKind instead of Def, where possible.
[rust.git] / src / librustc_mir / transform / const_prop.rs
index a114c18ace8b6f0287930eca57666ab3d8611df2..72af02782010679c81cfa69e822e967c049515bb 100644 (file)
@@ -1,7 +1,7 @@
 //! Propagates constants for early reporting of statically known
 //! assertion failures
 
-use rustc::hir::def::{Def, DefKind};
+use rustc::hir::def::DefKind;
 use rustc::mir::{
     Constant, Location, Place, PlaceBase, Mir, Operand, Rvalue, Local,
     NullOp, UnOp, StatementKind, Statement, LocalKind, Static, StaticKind,
@@ -42,8 +42,8 @@ fn run_pass<'a, 'tcx>(&self,
                               .expect("Non-local call to local provider is_const_fn");
 
         let is_fn_like = FnLikeNode::from_node(tcx.hir().get_by_hir_id(hir_id)).is_some();
-        let is_assoc_const = match tcx.describe_def(source.def_id()) {
-            Some(Def::Def(DefKind::AssociatedConst, _)) => true,
+        let is_assoc_const = match tcx.def_kind(source.def_id()) {
+            Some(DefKind::AssociatedConst) => true,
             _ => false,
         };