From 0142336a2a447e9883ae4dd6db98354154ba08e3 Mon Sep 17 00:00:00 2001 From: Michael Woerister Date: Fri, 6 May 2016 16:53:59 -0400 Subject: [PATCH] trans: Add some explanatory comments to trans::context types. --- src/librustc_trans/context.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/librustc_trans/context.rs b/src/librustc_trans/context.rs index 9692d31ee145..b182f4de26b2 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>, @@ -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>],