@@ -23,7 +23,6 @@ use middle::def::{self, DefMap};
23
23
use middle:: region;
24
24
use middle:: subst;
25
25
use middle:: ty;
26
- use std:: cell:: RefCell ;
27
26
use std:: fmt;
28
27
use std:: mem:: replace;
29
28
use syntax:: ast;
@@ -55,7 +54,7 @@ struct LifetimeContext<'a> {
55
54
sess : & ' a Session ,
56
55
named_region_map : & ' a mut NamedRegionMap ,
57
56
scope : Scope < ' a > ,
58
- def_map : & ' a RefCell < DefMap > ,
57
+ def_map : & ' a DefMap ,
59
58
// Deep breath. Our representation for poly trait refs contains a single
60
59
// binder and thus we only allow a single level of quantification. However,
61
60
// 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>;
94
93
95
94
static ROOT_SCOPE : ScopeChain < ' static > = RootScope ;
96
95
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 {
98
97
let mut named_region_map = NodeMap ( ) ;
99
98
visit:: walk_crate ( & mut LifetimeContext {
100
99
sess : sess,
@@ -206,7 +205,7 @@ impl<'a, 'v> Visitor<'v> for LifetimeContext<'a> {
206
205
hir:: TyPath ( None , ref path) => {
207
206
// if this path references a trait, then this will resolve to
208
207
// 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 ) ) {
210
209
Some ( ( def:: DefTrait ( ..) , 0 ) ) => {
211
210
self . with ( LateScope ( & Vec :: new ( ) , self . scope ) , |_, this| {
212
211
this. visit_path ( path, ty. id ) ;
0 commit comments