Skip to content

Commit 0142336

Browse files
trans: Add some explanatory comments to trans::context types.
1 parent a8e34df commit 0142336

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/librustc_trans/context.rs

+6
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ impl<'tcx> DepTrackingMapConfig for TraitSelectionCache<'tcx> {
190190
}
191191
}
192192

193+
/// This list owns a number of LocalCrateContexts and binds them to their common
194+
/// SharedCrateContext. This type just exists as a convenience, something to
195+
/// pass around all LocalCrateContexts with and get an iterator over them.
193196
pub struct CrateContextList<'a, 'tcx: 'a> {
194197
shared: &'a SharedCrateContext<'a, 'tcx>,
195198
local_ccxs: Vec<LocalCrateContext<'tcx>>,
@@ -229,6 +232,9 @@ impl<'a, 'tcx: 'a> CrateContextList<'a, 'tcx> {
229232
}
230233
}
231234

235+
/// A CrateContext value binds together one LocalCrateContext with the
236+
/// SharedCrateContext. It exists as a convenience wrapper, so we don't have to
237+
/// pass around (SharedCrateContext, LocalCrateContext) tuples all over trans.
232238
pub struct CrateContext<'a, 'tcx: 'a> {
233239
shared: &'a SharedCrateContext<'a, 'tcx>,
234240
local_ccxs: &'a [LocalCrateContext<'tcx>],

0 commit comments

Comments
 (0)