Tweak multispan rendering to reduce output length Consider comments and bare delimiters the same as an "empty line" for purposes of hiding rendered code output of long multispans. This results in more aggressive shortening of rendered output without losing too much context, specially in `*.stderr` tests that have "hidden" comments. We do that check not only on the first 4 lines of the multispan, but now also on the previous to last line as well.
312 lines
7.1 KiB
Text
312 lines
7.1 KiB
Text
error: infinite loop detected
|
|
--> tests/ui/infinite_loops.rs:13:5
|
|
|
|
|
LL | / loop {
|
|
LL | |
|
|
LL | | do_something();
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
= note: `-D clippy::infinite-loop` implied by `-D warnings`
|
|
= help: to override `-D warnings` add `#[allow(clippy::infinite_loop)]`
|
|
help: if this is intentional, consider specifying `!` as function return
|
|
|
|
|
LL | fn no_break() -> ! {
|
|
| ++++
|
|
|
|
error: infinite loop detected
|
|
--> tests/ui/infinite_loops.rs:20:5
|
|
|
|
|
LL | / loop {
|
|
LL | |
|
|
LL | | loop {
|
|
... |
|
|
LL | | do_something();
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
|
|
|
|
LL | fn all_inf() -> ! {
|
|
| ++++
|
|
|
|
error: infinite loop detected
|
|
--> tests/ui/infinite_loops.rs:22:9
|
|
|
|
|
LL | / loop {
|
|
LL | |
|
|
LL | | loop {
|
|
... |
|
|
LL | | }
|
|
| |_________^
|
|
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
|
|
|
|
LL | fn all_inf() -> ! {
|
|
| ++++
|
|
|
|
error: infinite loop detected
|
|
--> tests/ui/infinite_loops.rs:24:13
|
|
|
|
|
LL | / loop {
|
|
LL | |
|
|
LL | | do_something();
|
|
LL | | }
|
|
| |_____________^
|
|
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
|
|
|
|
LL | fn all_inf() -> ! {
|
|
| ++++
|
|
|
|
error: infinite loop detected
|
|
--> tests/ui/infinite_loops.rs:38:5
|
|
|
|
|
LL | / loop {
|
|
LL | |
|
|
LL | | do_something();
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
= help: if this is not intended, try adding a `break` or `return` condition in the loop
|
|
|
|
error: infinite loop detected
|
|
--> tests/ui/infinite_loops.rs:51:5
|
|
|
|
|
LL | / loop {
|
|
LL | | fn inner_fn() -> ! {
|
|
LL | | std::process::exit(0);
|
|
... |
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
|
|
|
|
LL | fn no_break_never_ret_noise() -> ! {
|
|
| ++++
|
|
|
|
error: infinite loop detected
|
|
--> tests/ui/infinite_loops.rs:94:5
|
|
|
|
|
LL | / loop {
|
|
LL | |
|
|
LL | | loop {
|
|
LL | | if cond {
|
|
... |
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
|
|
|
|
LL | fn break_inner_but_not_outer_1(cond: bool) -> ! {
|
|
| ++++
|
|
|
|
error: infinite loop detected
|
|
--> tests/ui/infinite_loops.rs:105:5
|
|
|
|
|
LL | / loop {
|
|
LL | |
|
|
LL | | 'inner: loop {
|
|
LL | | loop {
|
|
... |
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
|
|
|
|
LL | fn break_inner_but_not_outer_2(cond: bool) -> ! {
|
|
| ++++
|
|
|
|
error: infinite loop detected
|
|
--> tests/ui/infinite_loops.rs:119:9
|
|
|
|
|
LL | / loop {
|
|
LL | |
|
|
LL | | do_something();
|
|
LL | | }
|
|
| |_________^
|
|
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
|
|
|
|
LL | fn break_outer_but_not_inner() -> ! {
|
|
| ++++
|
|
|
|
error: infinite loop detected
|
|
--> tests/ui/infinite_loops.rs:142:9
|
|
|
|
|
LL | / loop {
|
|
LL | |
|
|
LL | | 'inner: loop {
|
|
LL | | loop {
|
|
... |
|
|
LL | | }
|
|
| |_________^
|
|
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
|
|
|
|
LL | fn break_wrong_loop(cond: bool) -> ! {
|
|
| ++++
|
|
|
|
error: infinite loop detected
|
|
--> tests/ui/infinite_loops.rs:182:5
|
|
|
|
|
LL | / loop {
|
|
LL | |
|
|
LL | | match opt {
|
|
LL | | Some(v) => {
|
|
... |
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
|
|
|
|
LL | fn match_like() -> ! {
|
|
| ++++
|
|
|
|
error: infinite loop detected
|
|
--> tests/ui/infinite_loops.rs:223:5
|
|
|
|
|
LL | / loop {
|
|
LL | |
|
|
LL | | let _x = matches!(result, Ok(v) if v != 0).then_some(0);
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
|
|
|
|
LL | fn match_like() -> ! {
|
|
| ++++
|
|
|
|
error: infinite loop detected
|
|
--> tests/ui/infinite_loops.rs:228:5
|
|
|
|
|
LL | / loop {
|
|
LL | |
|
|
LL | | // This `return` does not return the function, so it doesn't count
|
|
LL | | let _x = matches!(result, Ok(v) if v != 0).then(|| {
|
|
... |
|
|
LL | | });
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
|
|
|
|
LL | fn match_like() -> ! {
|
|
| ++++
|
|
|
|
error: infinite loop detected
|
|
--> tests/ui/infinite_loops.rs:333:9
|
|
|
|
|
LL | / loop {
|
|
LL | |
|
|
LL | | do_something();
|
|
LL | | }
|
|
| |_________^
|
|
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
|
|
|
|
LL | fn problematic_trait_method() -> ! {
|
|
| ++++
|
|
|
|
error: infinite loop detected
|
|
--> tests/ui/infinite_loops.rs:343:9
|
|
|
|
|
LL | / loop {
|
|
LL | |
|
|
LL | | do_something();
|
|
LL | | }
|
|
| |_________^
|
|
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
|
|
|
|
LL | fn could_be_problematic() -> ! {
|
|
| ++++
|
|
|
|
error: infinite loop detected
|
|
--> tests/ui/infinite_loops.rs:352:9
|
|
|
|
|
LL | / loop {
|
|
LL | |
|
|
LL | | do_something();
|
|
LL | | }
|
|
| |_________^
|
|
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
|
|
|
|
LL | let _loop_forever = || -> ! {
|
|
| ++++
|
|
|
|
error: infinite loop detected
|
|
--> tests/ui/infinite_loops.rs:366:8
|
|
|
|
|
LL | Ok(loop {
|
|
| ________^
|
|
LL | | do_something()
|
|
LL | | })
|
|
| |_____^
|
|
|
|
|
= help: if this is not intended, try adding a `break` or `return` condition in the loop
|
|
|
|
error: infinite loop detected
|
|
--> tests/ui/infinite_loops.rs:408:5
|
|
|
|
|
LL | / 'infinite: loop {
|
|
LL | |
|
|
LL | | loop {
|
|
LL | | continue 'infinite;
|
|
LL | | }
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
|
|
|
|
LL | fn continue_outer() -> ! {
|
|
| ++++
|
|
|
|
error: infinite loop detected
|
|
--> tests/ui/infinite_loops.rs:415:5
|
|
|
|
|
LL | / loop {
|
|
LL | |
|
|
LL | | 'inner: loop {
|
|
LL | | loop {
|
|
... |
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
|
|
|
|
LL | fn continue_outer() -> ! {
|
|
| ++++
|
|
|
|
error: infinite loop detected
|
|
--> tests/ui/infinite_loops.rs:417:9
|
|
|
|
|
LL | / 'inner: loop {
|
|
LL | | loop {
|
|
LL | | continue 'inner;
|
|
LL | | }
|
|
LL | | }
|
|
| |_________^
|
|
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
|
|
|
|
LL | fn continue_outer() -> ! {
|
|
| ++++
|
|
|
|
error: infinite loop detected
|
|
--> tests/ui/infinite_loops.rs:425:5
|
|
|
|
|
LL | / loop {
|
|
LL | |
|
|
LL | | continue;
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
help: if this is intentional, consider specifying `!` as function return
|
|
|
|
|
LL | fn continue_outer() -> ! {
|
|
| ++++
|
|
|
|
error: aborting due to 21 previous errors
|
|
|