@@ -215,7 +215,8 @@ rustc_queries! {
215
215
desc { |tcx| "elaborating item bounds for `{}`" , tcx. def_path_str( key) }
216
216
}
217
217
218
- query native_libraries( _: CrateNum ) -> Lrc <Vec <NativeLib >> {
218
+ query native_libraries( _: CrateNum ) -> Vec <NativeLib > {
219
+ storage( ArenaCacheSelector <' tcx>)
219
220
desc { "looking up the native libraries of a linked crate" }
220
221
separate_provide_extern
221
222
}
@@ -254,6 +255,7 @@ rustc_queries! {
254
255
/// Create a THIR tree for debugging.
255
256
query thir_tree( key: ty:: WithOptConstParam <LocalDefId >) -> String {
256
257
no_hash
258
+ storage( ArenaCacheSelector <' tcx>)
257
259
desc { |tcx| "constructing THIR tree for `{}`" , tcx. def_path_str( key. did. to_def_id( ) ) }
258
260
}
259
261
@@ -368,6 +370,7 @@ rustc_queries! {
368
370
query symbols_for_closure_captures(
369
371
key: ( LocalDefId , DefId )
370
372
) -> Vec <rustc_span:: Symbol > {
373
+ storage( ArenaCacheSelector <' tcx>)
371
374
desc {
372
375
|tcx| "symbols for captures of closure `{}` in `{}`" ,
373
376
tcx. def_path_str( key. 1 ) ,
@@ -538,7 +541,7 @@ rustc_queries! {
538
541
539
542
query adt_dtorck_constraint(
540
543
key: DefId
541
- ) -> Result <DtorckConstraint <' tcx>, NoSolution > {
544
+ ) -> Result <& ' tcx DtorckConstraint <' tcx>, NoSolution > {
542
545
desc { |tcx| "computing drop-check constraints for `{}`" , tcx. def_path_str( key) }
543
546
}
544
547
@@ -646,8 +649,8 @@ rustc_queries! {
646
649
/// The map returned for `tcx.impl_item_implementor_ids(impl_id)` would be
647
650
///`{ trait_f: impl_f, trait_g: impl_g }`
648
651
query impl_item_implementor_ids( impl_id: DefId ) -> FxHashMap <DefId , DefId > {
649
- desc { |tcx| "comparing impl items against trait for {}" , tcx. def_path_str( impl_id) }
650
652
storage( ArenaCacheSelector <' tcx>)
653
+ desc { |tcx| "comparing impl items against trait for {}" , tcx. def_path_str( impl_id) }
651
654
}
652
655
653
656
/// Given an `impl_id`, return the trait it implements.
@@ -1042,6 +1045,7 @@ rustc_queries! {
1042
1045
/// Gets the rendered value of the specified constant or associated constant.
1043
1046
/// Used by rustdoc.
1044
1047
query rendered_const( def_id: DefId ) -> String {
1048
+ storage( ArenaCacheSelector <' tcx>)
1045
1049
desc { |tcx| "rendering constant intializer of `{}`" , tcx. def_path_str( def_id) }
1046
1050
separate_provide_extern
1047
1051
}
@@ -1091,7 +1095,7 @@ rustc_queries! {
1091
1095
1092
1096
query codegen_fulfill_obligation(
1093
1097
key: ( ty:: ParamEnv <' tcx>, ty:: PolyTraitRef <' tcx>)
1094
- ) -> Result <ImplSource <' tcx, ( ) >, ErrorReported > {
1098
+ ) -> Result <& ' tcx ImplSource <' tcx, ( ) >, ErrorReported > {
1095
1099
cache_on_disk_if { true }
1096
1100
desc { |tcx|
1097
1101
"checking if `{}` fulfills its obligations" ,
@@ -1237,6 +1241,7 @@ rustc_queries! {
1237
1241
}
1238
1242
1239
1243
query dependency_formats( _: ( ) ) -> Lrc <crate :: middle:: dependency_format:: Dependencies > {
1244
+ storage( ArenaCacheSelector <' tcx>)
1240
1245
desc { "get the linkage format of all dependencies" }
1241
1246
}
1242
1247
@@ -1369,13 +1374,15 @@ rustc_queries! {
1369
1374
/// You likely want to call `Instance::upstream_monomorphization()`
1370
1375
/// instead of invoking this query directly.
1371
1376
query upstream_monomorphizations_for( def_id: DefId )
1372
- -> Option <& ' tcx FxHashMap <SubstsRef <' tcx>, CrateNum >> {
1373
- desc { |tcx|
1374
- "collecting available upstream monomorphizations for `{}`" ,
1375
- tcx. def_path_str ( def_id ) ,
1376
- }
1377
- separate_provide_extern
1377
+ -> Option <& ' tcx FxHashMap <SubstsRef <' tcx>, CrateNum >>
1378
+ {
1379
+ storage ( ArenaCacheSelector < ' tcx> )
1380
+ desc { | tcx|
1381
+ "collecting available upstream monomorphizations for `{}`" ,
1382
+ tcx . def_path_str ( def_id ) ,
1378
1383
}
1384
+ separate_provide_extern
1385
+ }
1379
1386
1380
1387
/// Returns the upstream crate that exports drop-glue for the given
1381
1388
/// type (`substs` is expected to be a single-item list containing the
@@ -1396,7 +1403,8 @@ rustc_queries! {
1396
1403
desc { "available upstream drop-glue for `{:?}`" , substs }
1397
1404
}
1398
1405
1399
- query foreign_modules( _: CrateNum ) -> Lrc <FxHashMap <DefId , ForeignModule >> {
1406
+ query foreign_modules( _: CrateNum ) -> FxHashMap <DefId , ForeignModule > {
1407
+ storage( ArenaCacheSelector <' tcx>)
1400
1408
desc { "looking up the foreign modules of a linked crate" }
1401
1409
separate_provide_extern
1402
1410
}
@@ -1422,11 +1430,13 @@ rustc_queries! {
1422
1430
separate_provide_extern
1423
1431
}
1424
1432
query extra_filename( _: CrateNum ) -> String {
1433
+ storage( ArenaCacheSelector <' tcx>)
1425
1434
eval_always
1426
1435
desc { "looking up the extra filename for a crate" }
1427
1436
separate_provide_extern
1428
1437
}
1429
1438
query crate_extern_paths( _: CrateNum ) -> Vec <PathBuf > {
1439
+ storage( ArenaCacheSelector <' tcx>)
1430
1440
eval_always
1431
1441
desc { "looking up the paths for extern crates" }
1432
1442
separate_provide_extern
@@ -1478,8 +1488,7 @@ rustc_queries! {
1478
1488
/// for each parameter if a trait object were to be passed for that parameter.
1479
1489
/// For example, for `struct Foo<'a, T, U>`, this would be `['static, 'static]`.
1480
1490
/// For `struct Foo<'a, T: 'a, U>`, this would instead be `['a, 'static]`.
1481
- query object_lifetime_defaults_map( _: LocalDefId )
1482
- -> Option <Vec <ObjectLifetimeDefault >> {
1491
+ query object_lifetime_defaults( _: LocalDefId ) -> Option <& ' tcx [ ObjectLifetimeDefault ] > {
1483
1492
desc { "looking up lifetime defaults for a region on an item" }
1484
1493
}
1485
1494
query late_bound_vars_map( _: LocalDefId )
@@ -1488,6 +1497,7 @@ rustc_queries! {
1488
1497
}
1489
1498
1490
1499
query lifetime_scope_map( _: LocalDefId ) -> Option <FxHashMap <ItemLocalId , LifetimeScopeForPath >> {
1500
+ storage( ArenaCacheSelector <' tcx>)
1491
1501
desc { "finds the lifetime scope for an HirId of a PathSegment" }
1492
1502
}
1493
1503
@@ -1501,7 +1511,7 @@ rustc_queries! {
1501
1511
/// check whether the forest is empty.
1502
1512
query type_uninhabited_from(
1503
1513
key: ty:: ParamEnvAnd <' tcx, Ty <' tcx>>
1504
- ) -> ty:: inhabitedness:: DefIdForest {
1514
+ ) -> ty:: inhabitedness:: DefIdForest < ' tcx> {
1505
1515
desc { "computing the inhabitedness of `{:?}`" , key }
1506
1516
remap_env_constness
1507
1517
}
@@ -1566,7 +1576,8 @@ rustc_queries! {
1566
1576
desc { "calculating the missing lang items in a crate" }
1567
1577
separate_provide_extern
1568
1578
}
1569
- query visible_parent_map( _: ( ) ) -> Lrc <DefIdMap <DefId >> {
1579
+ query visible_parent_map( _: ( ) ) -> DefIdMap <DefId > {
1580
+ storage( ArenaCacheSelector <' tcx>)
1570
1581
desc { "calculating the visible parent map" }
1571
1582
}
1572
1583
query trimmed_def_paths( _: ( ) ) -> FxHashMap <DefId , Symbol > {
@@ -1579,6 +1590,7 @@ rustc_queries! {
1579
1590
separate_provide_extern
1580
1591
}
1581
1592
query used_crate_source( _: CrateNum ) -> Lrc <CrateSource > {
1593
+ storage( ArenaCacheSelector <' tcx>)
1582
1594
eval_always
1583
1595
desc { "looking at the source for a crate" }
1584
1596
separate_provide_extern
@@ -1669,7 +1681,11 @@ rustc_queries! {
1669
1681
desc { "optimization level used by backend" }
1670
1682
}
1671
1683
1672
- query output_filenames( _: ( ) ) -> Arc <OutputFilenames > {
1684
+ /// Return the filenames where output artefacts shall be stored.
1685
+ ///
1686
+ /// This query returns an `&Arc` because codegen backends need the value even after the `TyCtxt`
1687
+ /// has been destroyed.
1688
+ query output_filenames( _: ( ) ) -> & ' tcx Arc <OutputFilenames > {
1673
1689
eval_always
1674
1690
desc { "output_filenames" }
1675
1691
}
@@ -1911,6 +1927,7 @@ rustc_queries! {
1911
1927
/// all of the cases that the normal `ty::Ty`-based wfcheck does. This is fine,
1912
1928
/// because the `ty::Ty`-based wfcheck is always run.
1913
1929
query diagnostic_hir_wf_check( key: ( ty:: Predicate <' tcx>, traits:: WellFormedLoc ) ) -> Option <traits:: ObligationCause <' tcx>> {
1930
+ storage( ArenaCacheSelector <' tcx>)
1914
1931
eval_always
1915
1932
no_hash
1916
1933
desc { "performing HIR wf-checking for predicate {:?} at item {:?}" , key. 0 , key. 1 }
0 commit comments