rust-clippy/tests/compile-fail
Oliver Schneider 902c7d832b fix cc computation in the presence of diverging calls
CFG treats diverging calls as its completely own path out of the function.
While this makes sense, it should also mean that a panic should increase the cyclomatic
complexity. Instead it decreases it.

Minimal example:

```rust
if a {
    b
} else {
    panic!("cake");
}
d
```

creates the following graph

```dot
digraph G {
  "if a" -> "b"
  "if a" -> "panic!(\"cake\")"
  "b" -> c
}
```

which has a CC of 1 (3 - 4 + 2). A CC of 1 means there is one path through the program.
Obviously that is wrong. There are two paths. One returning normally, and one panicking.
2015-12-14 14:29:20 +01:00
..
approx_const.rs Tests shouldn't be executable (fixes #444) 2015-11-09 08:49:20 +05:30
attrs.rs Tests shouldn't be executable (fixes #444) 2015-11-09 08:49:20 +05:30
bit_masks.rs Tests shouldn't be executable (fixes #444) 2015-11-09 08:49:20 +05:30
block_in_if_condition.rs Add block_in_if lint, #434 2015-11-22 21:52:06 +05:30
box_vec.rs Tests shouldn't be executable (fixes #444) 2015-11-09 08:49:20 +05:30
cast.rs Tests shouldn't be executable (fixes #444) 2015-11-09 08:49:20 +05:30
cmp_nan.rs Tests shouldn't be executable (fixes #444) 2015-11-09 08:49:20 +05:30
cmp_owned.rs Tests shouldn't be executable (fixes #444) 2015-11-09 08:49:20 +05:30
collapsible_if.rs Tests shouldn't be executable (fixes #444) 2015-11-09 08:49:20 +05:30
complex_types.rs Tests shouldn't be executable (fixes #444) 2015-11-09 08:49:20 +05:30
cyclomatic_complexity.rs fix cc computation in the presence of diverging calls 2015-12-14 14:29:20 +01:00
dlist.rs Tests shouldn't be executable (fixes #444) 2015-11-09 08:49:20 +05:30
eq_op.rs Tests shouldn't be executable (fixes #444) 2015-11-09 08:49:20 +05:30
escape_analysis.rs Rudimentary escape analysis for Box<T> 2015-12-04 20:23:14 +05:30
eta.rs Use suggestion for redundant_closure 2015-12-08 15:03:01 +09:00
float_cmp.rs use rustc's eval_const, bail on (negative) infinity 2015-11-10 11:23:47 +01:00
for_loop.rs compute cyclomatic complexity (adjusted to not punish Rust's match) 2015-12-03 16:41:55 +01:00
identity_op.rs Tests shouldn't be executable (fixes #444) 2015-11-09 08:49:20 +05:30
len_zero.rs Tests shouldn't be executable (fixes #444) 2015-11-09 08:49:20 +05:30
let_return.rs Tests shouldn't be executable (fixes #444) 2015-11-09 08:49:20 +05:30
let_unit.rs Tests shouldn't be executable (fixes #444) 2015-11-09 08:49:20 +05:30
lifetimes.rs Add lint for unused lifetimes (fixes #459) 2015-12-07 06:55:14 -05:00
map_clone.rs match .map(Clone::clone) 2015-11-05 17:11:41 +01:00
matches.rs Extend match_ref_pats to desugared matches 2015-11-25 02:47:17 +09:00
methods.rs Add lints suggesting map_or() and map_or_else() 2015-11-25 23:56:45 -08:00
min_max.rs Match min and max functions using DefId 2015-11-11 11:08:33 -05:00
modulo_one.rs Tests shouldn't be executable (fixes #444) 2015-11-09 08:49:20 +05:30
mut_mut.rs Tests shouldn't be executable (fixes #444) 2015-11-09 08:49:20 +05:30
mut_reference.rs Well, fix them again 2015-09-30 18:17:55 +02:00
mutex_atomic.rs Add a lint for sized integer types in a mutex 2015-10-07 22:58:34 +02:00
needless_bool.rs Tests shouldn't be executable (fixes #444) 2015-11-09 08:49:20 +05:30
needless_features.rs Cleanup as discussed in PR 2015-10-17 20:16:54 +02:00
needless_return.rs Tests shouldn't be executable (fixes #444) 2015-11-09 08:49:20 +05:30
needless_update.rs New lint for statement with no effect 2015-10-29 15:50:35 +09:00
no_effect.rs New lint for statement with no effect 2015-10-29 15:50:35 +09:00
open_options.rs Add "nonsensical OpenOptions" lint 2015-10-07 13:46:51 +02:00
patterns.rs Tests shouldn't be executable (fixes #444) 2015-11-09 08:49:20 +05:30
precedence.rs Tests shouldn't be executable (fixes #444) 2015-11-09 08:49:20 +05:30
ptr_arg.rs Tests shouldn't be executable (fixes #444) 2015-11-09 08:49:20 +05:30
range.rs New lint for zip with array length instead of enumerate() 2015-11-03 15:55:20 -05:00
shadow.rs Upgrade rust to rustc 1.6.0-nightly (462ec0576 2015-12-09) 2015-12-09 15:56:49 -05:00
strings.rs Tests shouldn't be executable (fixes #444) 2015-11-09 08:49:20 +05:30
temporary_assignment.rs New lint for assignment to temporary 2015-11-04 21:37:18 +09:00
toplevel_ref_arg.rs Handle let ref in toplevel_ref_arg as well 2015-09-22 12:46:51 +05:30
transmute.rs Upgrade rust to rustc 1.6.0-nightly (462ec0576 2015-12-09) 2015-12-09 15:56:49 -05:00
unicode.rs Tests shouldn't be executable (fixes #444) 2015-11-09 08:49:20 +05:30
unit_cmp.rs Tests shouldn't be executable (fixes #444) 2015-11-09 08:49:20 +05:30
unused_lt.rs Check for unused lifetimes in bounds (fixes #489) 2015-12-10 12:02:59 -05:00
while_loop.rs compute cyclomatic complexity (adjusted to not punish Rust's match) 2015-12-03 16:41:55 +01:00
zero_div_zero.rs implement 0.0/0.0 -> NaN lint as described in #370 2015-10-11 19:26:23 -07:00