Skip to content

Commit a3f0882

Browse files
committed
Add documentation for new error, and note in Function.
1 parent c536d39 commit a3f0882

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,6 +1120,9 @@ pub enum AllocationKind {
11201120
///
11211121
/// (This trait's design is inspired by, and derives heavily from, the
11221122
/// trait of the same name in regalloc.rs.)
1123+
///
1124+
/// The ids used in [`Block`] and [`VReg`] must start their numbering
1125+
/// at zero and be sequential.
11231126
pub trait Function {
11241127
// -------------
11251128
// CFG traversal
@@ -1557,10 +1560,12 @@ pub enum RegAllocError {
15571560
/// a block param.
15581561
SSA(VReg, Inst),
15591562
/// Invalid basic block: does not end in branch/ret, or contains a
1560-
/// branch/ret in the middle.
1563+
/// branch/ret in the middle, or the VReg ids do not start at zero
1564+
/// or aren't numbered sequentially.
15611565
BB(Block),
15621566
/// Invalid branch: operand count does not match sum of block
1563-
/// params of successor blocks.
1567+
/// params of successor blocks, or the block ids do not start at
1568+
/// zero or aren't numbered sequentially.
15641569
Branch(Inst),
15651570
/// A VReg is live-in on entry; this is not allowed.
15661571
EntryLivein,

0 commit comments

Comments
 (0)