Skip to content

Commit 1345390

Browse files
committed
Rust: correct some 'spurious' annotations that are off by one line.
1 parent 25b592f commit 1345390

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

rust/ql/test/query-tests/unusedentities/unreachable.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,16 @@ fn unreachable_panic() {
9797

9898
if cond() {
9999
do_something();
100-
_ = false && panic!(); // does not panic due to short-circuiting
101-
do_something(); // SPURIOUS: unreachable
100+
_ = false && panic!(); // does not panic due to short-circuiting SPURIOUS: unreachable
101+
do_something();
102102
_ = false || panic!();
103103
do_something(); // BAD: unreachable code [NOT DETECTED]
104104
}
105105

106106
if cond() {
107107
do_something();
108-
_ = true || panic!(); // does not panic due to short-circuiting
109-
do_something(); // SPURIOUS: unreachable
108+
_ = true || panic!(); // does not panic due to short-circuiting SPURIOUS: unreachable
109+
do_something();
110110
_ = true && panic!();
111111
do_something(); // BAD: unreachable code [NOT DETECTED]
112112
}

0 commit comments

Comments
 (0)