From 0cc69f0ea32ff0a479cc38e8ca9e4dab519e354a Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sun, 13 Dec 2015 01:50:07 +0300 Subject: [PATCH] rustc: Remove def::DefUse --- src/librustc/middle/def.rs | 5 ++--- src/librustc/middle/mem_categorization.rs | 2 +- src/librustc_metadata/astencode.rs | 1 - src/librustc_resolve/build_reduced_graph.rs | 1 - src/librustc_trans/save/dump_csv.rs | 1 - src/librustc_trans/trans/callee.rs | 2 +- src/librustc_typeck/check/mod.rs | 2 -- 7 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/librustc/middle/def.rs b/src/librustc/middle/def.rs index 809c6084b76..9ef2828c947 100644 --- a/src/librustc/middle/def.rs +++ b/src/librustc/middle/def.rs @@ -35,7 +35,6 @@ pub enum Def { DefTrait(DefId), DefPrimTy(hir::PrimTy), DefTyParam(ParamSpace, u32, DefId, ast::Name), - DefUse(DefId), DefUpvar(DefId, // def id of closed over local ast::NodeId, // node id of closed over local usize, // index in the freevars list of the closure @@ -123,7 +122,7 @@ impl Def { DefFn(..) | DefMod(..) | DefForeignMod(..) | DefStatic(..) | DefVariant(..) | DefTy(..) | DefAssociatedTy(..) | - DefTyParam(..) | DefUse(..) | DefStruct(..) | DefTrait(..) | + DefTyParam(..) | DefStruct(..) | DefTrait(..) | DefMethod(..) | DefConst(..) | DefAssociatedConst(..) | DefPrimTy(..) | DefLabel(..) | DefSelfTy(..) | DefErr => { panic!("attempted .def_id() on invalid {:?}", self) @@ -135,7 +134,7 @@ impl Def { match *self { DefFn(id, _) | DefMod(id) | DefForeignMod(id) | DefStatic(id, _) | DefVariant(_, id, _) | DefTy(id, _) | DefAssociatedTy(_, id) | - DefTyParam(_, _, id, _) | DefUse(id) | DefStruct(id) | DefTrait(id) | + DefTyParam(_, _, id, _) | DefStruct(id) | DefTrait(id) | DefMethod(id) | DefConst(id) | DefAssociatedConst(id) | DefLocal(id, _) | DefUpvar(id, _, _, _) => { id diff --git a/src/librustc/middle/mem_categorization.rs b/src/librustc/middle/mem_categorization.rs index f869cac9236..560d7eeed9e 100644 --- a/src/librustc/middle/mem_categorization.rs +++ b/src/librustc/middle/mem_categorization.rs @@ -548,7 +548,7 @@ impl<'t, 'a,'tcx> MemCategorizationContext<'t, 'a, 'tcx> { def::DefAssociatedConst(..) | def::DefFn(..) | def::DefMethod(..) => { Ok(self.cat_rvalue_node(id, span, expr_ty)) } - def::DefMod(_) | def::DefForeignMod(_) | def::DefUse(_) | + def::DefMod(_) | def::DefForeignMod(_) | def::DefTrait(_) | def::DefTy(..) | def::DefPrimTy(_) | def::DefTyParam(..) | def::DefLabel(_) | def::DefSelfTy(..) | diff --git a/src/librustc_metadata/astencode.rs b/src/librustc_metadata/astencode.rs index d43ffb0fc3f..714f0a4350b 100644 --- a/src/librustc_metadata/astencode.rs +++ b/src/librustc_metadata/astencode.rs @@ -399,7 +399,6 @@ impl tr for def::Def { def::DefAssociatedTy(trait_did.tr(dcx), did.tr(dcx)), def::DefPrimTy(p) => def::DefPrimTy(p), def::DefTyParam(s, index, def_id, n) => def::DefTyParam(s, index, def_id.tr(dcx), n), - def::DefUse(did) => def::DefUse(did.tr(dcx)), def::DefUpvar(_, nid1, index, nid2) => { let nid1 = dcx.tr_id(nid1); let nid2 = dcx.tr_id(nid2); diff --git a/src/librustc_resolve/build_reduced_graph.rs b/src/librustc_resolve/build_reduced_graph.rs index 8b5b6ff781e..f057dbdba53 100644 --- a/src/librustc_resolve/build_reduced_graph.rs +++ b/src/librustc_resolve/build_reduced_graph.rs @@ -706,7 +706,6 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> { DefLocal(..) | DefPrimTy(..) | DefTyParam(..) | - DefUse(..) | DefUpvar(..) | DefLabel(..) | DefSelfTy(..) | diff --git a/src/librustc_trans/save/dump_csv.rs b/src/librustc_trans/save/dump_csv.rs index b3e7ed7ed5e..bc704d96f16 100644 --- a/src/librustc_trans/save/dump_csv.rs +++ b/src/librustc_trans/save/dump_csv.rs @@ -274,7 +274,6 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> { def::DefSelfTy(..) | def::DefLabel(_) | def::DefTyParam(..) | - def::DefUse(_) | def::DefMethod(..) | def::DefPrimTy(_) | def::DefErr => { diff --git a/src/librustc_trans/trans/callee.rs b/src/librustc_trans/trans/callee.rs index a22c12588e5..966033e9f25 100644 --- a/src/librustc_trans/trans/callee.rs +++ b/src/librustc_trans/trans/callee.rs @@ -215,7 +215,7 @@ fn trans<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, expr: &hir::Expr) } def::DefMod(..) | def::DefForeignMod(..) | def::DefTrait(..) | def::DefTy(..) | def::DefPrimTy(..) | def::DefAssociatedTy(..) | - def::DefUse(..) | def::DefLabel(..) | def::DefTyParam(..) | + def::DefLabel(..) | def::DefTyParam(..) | def::DefSelfTy(..) | def::DefErr => { bcx.tcx().sess.span_bug( ref_expr.span, diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 1f3d8f55120..8c9871f00cf 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -4327,7 +4327,6 @@ fn type_scheme_and_predicates_for_def<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>, def::DefTyParam(..) | def::DefMod(..) | def::DefForeignMod(..) | - def::DefUse(..) | def::DefLabel(..) | def::DefSelfTy(..) | def::DefErr => { @@ -4498,7 +4497,6 @@ pub fn instantiate_path<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>, def::DefMod(..) | def::DefForeignMod(..) | def::DefLocal(..) | - def::DefUse(..) | def::DefLabel(..) | def::DefUpvar(..) | def::DefErr => {