diff --git a/src/librustc/middle/astencode.rs b/src/librustc/middle/astencode.rs index 6125b789772..69c9896c09b 100644 --- a/src/librustc/middle/astencode.rs +++ b/src/librustc/middle/astencode.rs @@ -476,7 +476,6 @@ impl tr for def::Def { def::DefUpvar(dcx.tr_id(nid1), index, dcx.tr_id(nid2)) } def::DefStruct(did) => def::DefStruct(did.tr(dcx)), - def::DefRegion(nid) => def::DefRegion(dcx.tr_id(nid)), def::DefLabel(nid) => def::DefLabel(dcx.tr_id(nid)) } } diff --git a/src/librustc/middle/def.rs b/src/librustc/middle/def.rs index ee1319a325e..d87d45fdd96 100644 --- a/src/librustc/middle/def.rs +++ b/src/librustc/middle/def.rs @@ -50,7 +50,6 @@ pub enum Def { /// - If it's an ExprPath referring to some tuple struct, then DefMap maps /// it to a def whose id is the StructDef.ctor_id. DefStruct(DefId), - DefRegion(ast::NodeId), DefLabel(ast::NodeId), DefMethod(DefId), } @@ -125,7 +124,7 @@ impl Def { DefVariant(..) | DefTy(..) | DefAssociatedTy(..) | DefTyParam(..) | DefUse(..) | DefStruct(..) | DefTrait(..) | DefMethod(..) | DefConst(..) | DefAssociatedConst(..) | - DefPrimTy(..) | DefRegion(..) | DefLabel(..) | DefSelfTy(..) => { + DefPrimTy(..) | DefLabel(..) | DefSelfTy(..) => { panic!("attempted .def_id() on invalid {:?}", self) } } @@ -143,7 +142,6 @@ impl Def { DefLocal(id) | DefUpvar(id, _, _) | - DefRegion(id) | DefLabel(id) | DefSelfTy(_, Some((_, id))) => { DefId::xxx_local(id) // TODO, clearly diff --git a/src/librustc/middle/mem_categorization.rs b/src/librustc/middle/mem_categorization.rs index 2e7d9e89824..34b66ccded0 100644 --- a/src/librustc/middle/mem_categorization.rs +++ b/src/librustc/middle/mem_categorization.rs @@ -551,7 +551,7 @@ impl<'t, 'a,'tcx> MemCategorizationContext<'t, 'a, 'tcx> { } def::DefMod(_) | def::DefForeignMod(_) | def::DefUse(_) | def::DefTrait(_) | def::DefTy(..) | def::DefPrimTy(_) | - def::DefTyParam(..) | def::DefRegion(_) | + def::DefTyParam(..) | def::DefLabel(_) | def::DefSelfTy(..) | def::DefAssociatedTy(..) => { Ok(Rc::new(cmt_ { diff --git a/src/librustc_resolve/build_reduced_graph.rs b/src/librustc_resolve/build_reduced_graph.rs index 3a53c8b4d8c..c50cb5960b1 100644 --- a/src/librustc_resolve/build_reduced_graph.rs +++ b/src/librustc_resolve/build_reduced_graph.rs @@ -816,7 +816,7 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> { self.structs.insert(def_id, fields); } DefLocal(..) | DefPrimTy(..) | DefTyParam(..) | - DefUse(..) | DefUpvar(..) | DefRegion(..) | + DefUse(..) | DefUpvar(..) | DefLabel(..) | DefSelfTy(..) => { panic!("didn't expect `{:?}`", def); } diff --git a/src/librustc_trans/save/dump_csv.rs b/src/librustc_trans/save/dump_csv.rs index 6c53762c3ea..9750a81d810 100644 --- a/src/librustc_trans/save/dump_csv.rs +++ b/src/librustc_trans/save/dump_csv.rs @@ -264,7 +264,6 @@ impl <'l, 'tcx> DumpCsvVisitor<'l, 'tcx> { def::DefFn(..) => Some(recorder::FnRef), def::DefSelfTy(..) | - def::DefRegion(_) | def::DefLabel(_) | def::DefTyParam(..) | def::DefUse(_) | diff --git a/src/librustc_trans/trans/callee.rs b/src/librustc_trans/trans/callee.rs index df9dd8feafa..b806f36b910 100644 --- a/src/librustc_trans/trans/callee.rs +++ b/src/librustc_trans/trans/callee.rs @@ -215,8 +215,8 @@ 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::DefRegion(..) | def::DefLabel(..) | - def::DefTyParam(..) | def::DefSelfTy(..) => { + def::DefUse(..) | def::DefLabel(..) | def::DefTyParam(..) | + def::DefSelfTy(..) => { bcx.tcx().sess.span_bug( ref_expr.span, &format!("cannot translate def {:?} \ diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 7d4101fa243..639ff9ad0ba 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -4318,7 +4318,6 @@ fn type_scheme_and_predicates_for_def<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>, def::DefMod(..) | def::DefForeignMod(..) | def::DefUse(..) | - def::DefRegion(..) | def::DefLabel(..) | def::DefSelfTy(..) => { fcx.ccx.tcx.sess.span_bug(sp, &format!("expected value, found {:?}", defn)); @@ -4489,7 +4488,6 @@ pub fn instantiate_path<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>, def::DefForeignMod(..) | def::DefLocal(..) | def::DefUse(..) | - def::DefRegion(..) | def::DefLabel(..) | def::DefUpvar(..) => { segment_spaces = vec![None; segments.len()];