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> {
20
20
// Typically 95%+ of basic blocks have 4 or fewer predecessors.
21
21
type Predecessors = IndexVec < BasicBlock , SmallVec < [ BasicBlock ; 4 ] > > ;
22
22
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.
23
30
type SwitchSources = FxHashMap < ( BasicBlock , BasicBlock ) , SmallVec < [ Option < u128 > ; 1 ] > > ;
24
31
25
32
#[ derive( Clone , Default , Debug ) ]
@@ -70,8 +77,8 @@ impl<'tcx> BasicBlocks<'tcx> {
70
77
} )
71
78
}
72
79
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` .
75
82
#[ inline]
76
83
pub fn switch_sources ( & self ) -> & SwitchSources {
77
84
self . cache . switch_sources . get_or_init ( || {
You can’t perform that action at this time.
0 commit comments