@@ -33,8 +33,6 @@ use syntax::visit;
33
33
use syntax:: visit:: Visitor ;
34
34
use util:: nodemap:: NodeMap ;
35
35
36
- use std:: cell:: RefCell ;
37
-
38
36
#[ derive( Clone , Copy , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable , Debug ) ]
39
37
pub enum DefRegion {
40
38
DefStaticRegion ,
@@ -55,7 +53,7 @@ struct LifetimeContext<'a> {
55
53
sess : & ' a Session ,
56
54
named_region_map : & ' a mut NamedRegionMap ,
57
55
scope : Scope < ' a > ,
58
- def_map : & ' a RefCell < DefMap > ,
56
+ def_map : & ' a DefMap ,
59
57
// Deep breath. Our representation for poly trait refs contains a single
60
58
// binder and thus we only allow a single level of quantification. However,
61
59
// the syntax of Rust permits quantification in two places, e.g., `T: for <'a> Foo<'a>`
@@ -91,7 +89,7 @@ type Scope<'a> = &'a ScopeChain<'a>;
91
89
92
90
static ROOT_SCOPE : ScopeChain < ' static > = RootScope ;
93
91
94
- pub fn krate ( sess : & Session , krate : & ast:: Crate , def_map : & RefCell < DefMap > ) -> NamedRegionMap {
92
+ pub fn krate ( sess : & Session , krate : & ast:: Crate , def_map : & DefMap ) -> NamedRegionMap {
95
93
let mut named_region_map = NodeMap ( ) ;
96
94
visit:: walk_crate ( & mut LifetimeContext {
97
95
sess : sess,
@@ -174,7 +172,7 @@ impl<'a, 'v> Visitor<'v> for LifetimeContext<'a> {
174
172
ast:: TyPath ( None , ref path) => {
175
173
// if this path references a trait, then this will resolve to
176
174
// a trait ref, which introduces a binding scope.
177
- match self . def_map . borrow ( ) . get ( & ty. id ) . map ( |d| ( d. base_def , d. depth ) ) {
175
+ match self . def_map . get ( & ty. id ) . map ( |d| ( d. base_def , d. depth ) ) {
178
176
Some ( ( def:: DefTrait ( ..) , 0 ) ) => {
179
177
self . with ( LateScope ( & Vec :: new ( ) , self . scope ) , |_, this| {
180
178
this. visit_path ( path, ty. id ) ;
0 commit comments