]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/middle/region.rs
rustc: split off BodyOwnerKind from MirSource.
[rust.git] / src / librustc / middle / region.rs
index 89707839144ccdffb2a22be63a246f0f03012d8f..a7882992d61c4a79e8649abd01486a12e2b0db2f 100644 (file)
@@ -31,7 +31,6 @@
 use hir::def_id::DefId;
 use hir::intravisit::{self, Visitor, NestedVisitorMap};
 use hir::{Block, Arm, Pat, PatKind, Stmt, Expr, Local};
-use mir::transform::MirSource;
 use rustc_data_structures::indexed_vec::Idx;
 use rustc_data_structures::stable_hasher::{HashStable, StableHasher,
                                            StableHasherResult};
@@ -1298,7 +1297,7 @@ fn visit_body(&mut self, body: &'tcx hir::Body) {
 
         // The body of the every fn is a root scope.
         self.cx.parent = self.cx.var_parent;
-        if let MirSource::Fn(_) = MirSource::from_node(self.tcx, owner_id) {
+        if let hir::BodyOwnerKind::Fn = self.tcx.hir.body_owner_kind(owner_id) {
             self.visit_expr(&body.value);
         } else {
             // Only functions have an outer terminating (drop) scope, while