@@ -3222,84 +3222,6 @@ impl<'tcx> CommonTypes<'tcx> {
3222
3222
}
3223
3223
}
3224
3224
3225
- /// Create a type context and call the closure with a `&ty::ctxt` reference
3226
- /// to the context. The closure enforces that the type context and any interned
3227
- /// value (types, substs, etc.) can only be used while `ty::tls` has a valid
3228
- /// reference to the context, to allow formatting values that need it.
3229
- pub fn with_ctxt < ' tcx , F , R > ( s : Session ,
3230
- arenas : & ' tcx CtxtArenas < ' tcx > ,
3231
- def_map : DefMap ,
3232
- named_region_map : resolve_lifetime:: NamedRegionMap ,
3233
- map : ast_map:: Map < ' tcx > ,
3234
- freevars : RefCell < FreevarMap > ,
3235
- region_maps : RegionMaps ,
3236
- lang_items : middle:: lang_items:: LanguageItems ,
3237
- stability : stability:: Index < ' tcx > ,
3238
- f : F ) -> ( Session , R )
3239
- where F : FnOnce ( & ctxt < ' tcx > ) -> R
3240
- {
3241
- let mut interner = FnvHashMap ( ) ;
3242
- let common_types = CommonTypes :: new ( & arenas. type_ , & mut interner) ;
3243
-
3244
- tls:: enter ( ctxt {
3245
- arenas : arenas,
3246
- interner : RefCell :: new ( interner) ,
3247
- substs_interner : RefCell :: new ( FnvHashMap ( ) ) ,
3248
- bare_fn_interner : RefCell :: new ( FnvHashMap ( ) ) ,
3249
- region_interner : RefCell :: new ( FnvHashMap ( ) ) ,
3250
- stability_interner : RefCell :: new ( FnvHashMap ( ) ) ,
3251
- types : common_types,
3252
- named_region_map : named_region_map,
3253
- region_maps : region_maps,
3254
- free_region_maps : RefCell :: new ( FnvHashMap ( ) ) ,
3255
- item_variance_map : RefCell :: new ( DefIdMap ( ) ) ,
3256
- variance_computed : Cell :: new ( false ) ,
3257
- sess : s,
3258
- def_map : def_map,
3259
- tables : RefCell :: new ( Tables :: empty ( ) ) ,
3260
- impl_trait_refs : RefCell :: new ( DefIdMap ( ) ) ,
3261
- trait_defs : RefCell :: new ( DefIdMap ( ) ) ,
3262
- predicates : RefCell :: new ( DefIdMap ( ) ) ,
3263
- super_predicates : RefCell :: new ( DefIdMap ( ) ) ,
3264
- fulfilled_predicates : RefCell :: new ( traits:: FulfilledPredicates :: new ( ) ) ,
3265
- map : map,
3266
- freevars : freevars,
3267
- tcache : RefCell :: new ( DefIdMap ( ) ) ,
3268
- rcache : RefCell :: new ( FnvHashMap ( ) ) ,
3269
- tc_cache : RefCell :: new ( FnvHashMap ( ) ) ,
3270
- ast_ty_to_ty_cache : RefCell :: new ( NodeMap ( ) ) ,
3271
- enum_var_cache : RefCell :: new ( DefIdMap ( ) ) ,
3272
- impl_or_trait_items : RefCell :: new ( DefIdMap ( ) ) ,
3273
- trait_item_def_ids : RefCell :: new ( DefIdMap ( ) ) ,
3274
- trait_items_cache : RefCell :: new ( DefIdMap ( ) ) ,
3275
- ty_param_defs : RefCell :: new ( NodeMap ( ) ) ,
3276
- normalized_cache : RefCell :: new ( FnvHashMap ( ) ) ,
3277
- lang_items : lang_items,
3278
- provided_method_sources : RefCell :: new ( DefIdMap ( ) ) ,
3279
- struct_fields : RefCell :: new ( DefIdMap ( ) ) ,
3280
- destructor_for_type : RefCell :: new ( DefIdMap ( ) ) ,
3281
- destructors : RefCell :: new ( DefIdSet ( ) ) ,
3282
- inherent_impls : RefCell :: new ( DefIdMap ( ) ) ,
3283
- impl_items : RefCell :: new ( DefIdMap ( ) ) ,
3284
- used_unsafe : RefCell :: new ( NodeSet ( ) ) ,
3285
- used_mut_nodes : RefCell :: new ( NodeSet ( ) ) ,
3286
- populated_external_types : RefCell :: new ( DefIdSet ( ) ) ,
3287
- populated_external_primitive_impls : RefCell :: new ( DefIdSet ( ) ) ,
3288
- extern_const_statics : RefCell :: new ( DefIdMap ( ) ) ,
3289
- extern_const_variants : RefCell :: new ( DefIdMap ( ) ) ,
3290
- extern_const_fns : RefCell :: new ( DefIdMap ( ) ) ,
3291
- dependency_formats : RefCell :: new ( FnvHashMap ( ) ) ,
3292
- node_lint_levels : RefCell :: new ( FnvHashMap ( ) ) ,
3293
- transmute_restrictions : RefCell :: new ( Vec :: new ( ) ) ,
3294
- stability : RefCell :: new ( stability) ,
3295
- selection_cache : traits:: SelectionCache :: new ( ) ,
3296
- repr_hint_cache : RefCell :: new ( DefIdMap ( ) ) ,
3297
- const_qualif_map : RefCell :: new ( NodeMap ( ) ) ,
3298
- custom_coerce_unsized_kinds : RefCell :: new ( DefIdMap ( ) ) ,
3299
- cast_kinds : RefCell :: new ( NodeMap ( ) ) ,
3300
- } , f)
3301
- }
3302
-
3303
3225
struct FlagComputation {
3304
3226
flags : TypeFlags ,
3305
3227
0 commit comments