@@ -25,9 +25,8 @@ use rustc::ty::wf::object_region_bounds;
25
25
use rustc_back:: slice;
26
26
use require_c_abi_if_variadic;
27
27
use util:: common:: { ErrorReported , FN_OUTPUT_NAME } ;
28
- use util:: nodemap:: { NodeMap , FxHashSet } ;
28
+ use util:: nodemap:: FxHashSet ;
29
29
30
- use std:: cell:: RefCell ;
31
30
use std:: iter;
32
31
use syntax:: { abi, ast} ;
33
32
use syntax:: feature_gate:: { GateIssue , emit_feature_err} ;
@@ -37,9 +36,6 @@ use syntax_pos::Span;
37
36
pub trait AstConv < ' gcx , ' tcx > {
38
37
fn tcx < ' a > ( & ' a self ) -> TyCtxt < ' a , ' gcx , ' tcx > ;
39
38
40
- /// A cache used for the result of `ast_ty_to_ty_cache`
41
- fn ast_ty_to_ty_cache ( & self ) -> & RefCell < NodeMap < Ty < ' tcx > > > ;
42
-
43
39
/// Returns the set of bounds in scope for the type parameter with
44
40
/// the given id.
45
41
fn get_type_parameter_bounds ( & self , span : Span , def_id : DefId )
@@ -1074,11 +1070,6 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
1074
1070
1075
1071
let tcx = self . tcx ( ) ;
1076
1072
1077
- let cache = self . ast_ty_to_ty_cache ( ) ;
1078
- if let Some ( ty) = cache. borrow ( ) . get ( & ast_ty. id ) {
1079
- return ty;
1080
- }
1081
-
1082
1073
let result_ty = match ast_ty. node {
1083
1074
hir:: TySlice ( ref ty) => {
1084
1075
tcx. mk_slice ( self . ast_ty_to_ty ( & ty) )
@@ -1240,8 +1231,6 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
1240
1231
}
1241
1232
} ;
1242
1233
1243
- cache. borrow_mut ( ) . insert ( ast_ty. id , result_ty) ;
1244
-
1245
1234
result_ty
1246
1235
}
1247
1236
0 commit comments