@@ -23,7 +23,6 @@ use middle::def::{self, DefMap};
2323use middle:: region;
2424use middle:: subst;
2525use middle:: ty;
26- use std:: cell:: RefCell ;
2726use std:: fmt;
2827use std:: mem:: replace;
2928use syntax:: ast;
@@ -55,7 +54,7 @@ struct LifetimeContext<'a> {
5554 sess : & ' a Session ,
5655 named_region_map : & ' a mut NamedRegionMap ,
5756 scope : Scope < ' a > ,
58- def_map : & ' a RefCell < DefMap > ,
57+ def_map : & ' a DefMap ,
5958 // Deep breath. Our representation for poly trait refs contains a single
6059 // binder and thus we only allow a single level of quantification. However,
6160 // the syntax of Rust permits quantification in two places, e.g., `T: for <'a> Foo<'a>`
@@ -94,7 +93,7 @@ type Scope<'a> = &'a ScopeChain<'a>;
9493
9594static ROOT_SCOPE : ScopeChain < ' static > = RootScope ;
9695
97- pub fn krate ( sess : & Session , krate : & hir:: Crate , def_map : & RefCell < DefMap > ) -> NamedRegionMap {
96+ pub fn krate ( sess : & Session , krate : & hir:: Crate , def_map : & DefMap ) -> NamedRegionMap {
9897 let mut named_region_map = NodeMap ( ) ;
9998 visit:: walk_crate ( & mut LifetimeContext {
10099 sess : sess,
@@ -206,7 +205,7 @@ impl<'a, 'v> Visitor<'v> for LifetimeContext<'a> {
206205 hir:: TyPath ( None , ref path) => {
207206 // if this path references a trait, then this will resolve to
208207 // a trait ref, which introduces a binding scope.
209- match self . def_map . borrow ( ) . get ( & ty. id ) . map ( |d| ( d. base_def , d. depth ) ) {
208+ match self . def_map . get ( & ty. id ) . map ( |d| ( d. base_def , d. depth ) ) {
210209 Some ( ( def:: DefTrait ( ..) , 0 ) ) => {
211210 self . with ( LateScope ( & Vec :: new ( ) , self . scope ) , |_, this| {
212211 this. visit_path ( path, ty. id ) ;
0 commit comments