about summary refs log tree commit diff
path: root/compiler/rustc_const_eval
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2023-05-14 00:00:00 +0000
committerTomasz Miąsko <tomasz.miasko@gmail.com>2023-05-14 16:09:58 +0200
commitf16d2b1629d62db306bd9d03676524dc848c94b4 (patch)
treee4ab54d16f6282279d1ead4006e5635f7db23f7c /compiler/rustc_const_eval
parent3603a84a3d74d0b70dbbdaa47ed8f8a306f3fe7f (diff)
downloadrust-f16d2b1629d62db306bd9d03676524dc848c94b4.tar.gz
rust-f16d2b1629d62db306bd9d03676524dc848c94b4.zip
Start node has no immediate dominator
Change the immediate_dominator return type to Option, and use None to
indicate that node has no immediate dominator.

Also fix the issue where the start node would be returned as its own
immediate dominator.
Diffstat (limited to 'compiler/rustc_const_eval')
-rw-r--r--compiler/rustc_const_eval/src/transform/validate.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_const_eval/src/transform/validate.rs b/compiler/rustc_const_eval/src/transform/validate.rs
index c50e937d84f..3c350e25ba6 100644
--- a/compiler/rustc_const_eval/src/transform/validate.rs
+++ b/compiler/rustc_const_eval/src/transform/validate.rs
@@ -164,7 +164,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
                 if let Some(root) = post_contract_node.get(&bb) {
                     break *root;
                 }
-                let parent = doms.immediate_dominator(bb);
+                let parent = doms.immediate_dominator(bb).unwrap();
                 dom_path.push(bb);
                 if !self.body.basic_blocks[parent].is_cleanup {
                     break bb;