File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
compiler/rustc_middle/src/mir Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,13 @@ pub struct BasicBlocks<'tcx> {
2020// Typically 95%+ of basic blocks have 4 or fewer predecessors.
2121type Predecessors = IndexVec < BasicBlock , SmallVec < [ BasicBlock ; 4 ] > > ;
2222
23+ /// Each `(target, switch)` entry in the map contains a list of switch values
24+ /// that lead to a `target` block from a `switch` block.
25+ ///
26+ /// Note: this type is currently never instantiated, because it's only used for
27+ /// `BasicBlocks::switch_sources`, which is only called by backwards analyses
28+ /// that do `SwitchInt` handling, and we don't have any of those, not even in
29+ /// tests. See #95120 and #94576.
2330type SwitchSources = FxHashMap < ( BasicBlock , BasicBlock ) , SmallVec < [ Option < u128 > ; 1 ] > > ;
2431
2532#[ derive( Clone , Default , Debug ) ]
@@ -70,8 +77,8 @@ impl<'tcx> BasicBlocks<'tcx> {
7077 } )
7178 }
7279
73- /// `switch_sources()[&(target, switch)]` returns a list of switch
74- /// values that lead to a `target` block from a `switch` block .
80+ /// Returns info about switch values that lead from one block to another
81+ /// block. See `SwitchSources` .
7582 #[ inline]
7683 pub fn switch_sources ( & self ) -> & SwitchSources {
7784 self . cache . switch_sources . get_or_init ( || {
You can’t perform that action at this time.
0 commit comments