@@ -8,7 +8,7 @@ use rustc_ast::expand::allocator::AllocatorKind;
8
8
use rustc_ast:: { self as ast, * } ;
9
9
use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
10
10
use rustc_data_structures:: svh:: Svh ;
11
- use rustc_data_structures:: sync:: { MappedReadGuard , ReadGuard } ;
11
+ use rustc_data_structures:: sync:: MappedReadGuard ;
12
12
use rustc_expand:: base:: SyntaxExtension ;
13
13
use rustc_hir:: def_id:: { CrateNum , LocalDefId , StableCrateId , LOCAL_CRATE } ;
14
14
use rustc_hir:: definitions:: Definitions ;
@@ -64,7 +64,6 @@ pub struct CrateLoader<'a> {
64
64
// Immutable configuration.
65
65
sess : & ' a Session ,
66
66
metadata_loader : & ' a MetadataLoaderDyn ,
67
- definitions : ReadGuard < ' a , Definitions > ,
68
67
local_crate_name : Symbol ,
69
68
// Mutable output.
70
69
cstore : & ' a mut CStore ,
@@ -261,17 +260,9 @@ impl<'a> CrateLoader<'a> {
261
260
metadata_loader : & ' a MetadataLoaderDyn ,
262
261
local_crate_name : Symbol ,
263
262
cstore : & ' a mut CStore ,
264
- definitions : ReadGuard < ' a , Definitions > ,
265
263
used_extern_options : & ' a mut FxHashSet < Symbol > ,
266
264
) -> Self {
267
- CrateLoader {
268
- sess,
269
- metadata_loader,
270
- local_crate_name,
271
- cstore,
272
- used_extern_options,
273
- definitions,
274
- }
265
+ CrateLoader { sess, metadata_loader, local_crate_name, cstore, used_extern_options }
275
266
}
276
267
pub fn cstore ( & self ) -> & CStore {
277
268
& self . cstore
@@ -989,6 +980,7 @@ impl<'a> CrateLoader<'a> {
989
980
& mut self ,
990
981
item : & ast:: Item ,
991
982
def_id : LocalDefId ,
983
+ definitions : & Definitions ,
992
984
) -> Option < CrateNum > {
993
985
match item. kind {
994
986
ast:: ItemKind :: ExternCrate ( orig_name) => {
@@ -1011,7 +1003,7 @@ impl<'a> CrateLoader<'a> {
1011
1003
1012
1004
let cnum = self . resolve_crate ( name, item. span , dep_kind) ?;
1013
1005
1014
- let path_len = self . definitions . def_path ( def_id) . data . len ( ) ;
1006
+ let path_len = definitions. def_path ( def_id) . data . len ( ) ;
1015
1007
self . update_extern_crate (
1016
1008
cnum,
1017
1009
ExternCrate {
0 commit comments