about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Woerister <michaelwoerister@posteo.net>2016-05-06 16:53:59 -0400
committerMichael Woerister <michaelwoerister@posteo.net>2016-05-09 16:17:00 -0400
commit0142336a2a447e9883ae4dd6db98354154ba08e3 (patch)
treee236773b81d0f36676b9ad067f9954a7b5dbdab5
parenta8e34dfc29df9ca817e9d1e91f3e49f6d405fe28 (diff)
downloadrust-0142336a2a447e9883ae4dd6db98354154ba08e3.tar.gz
rust-0142336a2a447e9883ae4dd6db98354154ba08e3.zip
trans: Add some explanatory comments to trans::context types.
-rw-r--r--src/librustc_trans/context.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/librustc_trans/context.rs b/src/librustc_trans/context.rs
index 9692d31ee14..b182f4de26b 100644
--- a/src/librustc_trans/context.rs
+++ b/src/librustc_trans/context.rs
@@ -190,6 +190,9 @@ impl<'tcx> DepTrackingMapConfig for TraitSelectionCache<'tcx> {
     }
 }
 
+/// This list owns a number of LocalCrateContexts and binds them to their common
+/// SharedCrateContext. This type just exists as a convenience, something to
+/// pass around all LocalCrateContexts with and get an iterator over them.
 pub struct CrateContextList<'a, 'tcx: 'a> {
     shared: &'a SharedCrateContext<'a, 'tcx>,
     local_ccxs: Vec<LocalCrateContext<'tcx>>,
@@ -229,6 +232,9 @@ impl<'a, 'tcx: 'a> CrateContextList<'a, 'tcx> {
     }
 }
 
+/// A CrateContext value binds together one LocalCrateContext with the
+/// SharedCrateContext. It exists as a convenience wrapper, so we don't have to
+/// pass around (SharedCrateContext, LocalCrateContext) tuples all over trans.
 pub struct CrateContext<'a, 'tcx: 'a> {
     shared: &'a SharedCrateContext<'a, 'tcx>,
     local_ccxs: &'a [LocalCrateContext<'tcx>],