rust/tests/ui/infinite_loops.stderr

148 lines
3.4 KiB
Plaintext
Raw Normal View History

error: infinite loop detected
--> $DIR/infinite_loops.rs:8:5
|
LL | / loop {
LL | |
LL | | do_something();
LL | | }
| |_____^
|
= note: `-D clippy::infinite-loops` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::infinite_loops)]`
help: if this is intentional, consider specifing `!` as function return
|
LL | fn no_break() -> ! {
| ++++
error: infinite loop detected
--> $DIR/infinite_loops.rs:21:5
|
LL | / loop {
LL | | fn inner_fn() -> ! {
LL | | std::process::exit(0);
LL | | }
LL | | do_something();
LL | | }
| |_____^
|
help: if this is intentional, consider specifing `!` as function return
|
LL | fn no_break_never_ret_noise() -> ! {
| ++++
error: infinite loop detected
--> $DIR/infinite_loops.rs:64:5
|
LL | / loop {
LL | |
LL | | loop {
LL | | if cond {
... |
LL | | }
LL | | }
| |_____^
|
help: if this is intentional, consider specifing `!` as function return
|
LL | fn break_inner_but_not_outer_1(cond: bool) -> ! {
| ++++
error: infinite loop detected
--> $DIR/infinite_loops.rs:75:5
|
LL | / loop {
LL | |
LL | | 'inner: loop {
LL | | loop {
... |
LL | | }
LL | | }
| |_____^
|
help: if this is intentional, consider specifing `!` as function return
|
LL | fn break_inner_but_not_outer_2(cond: bool) -> ! {
| ++++
error: infinite loop detected
--> $DIR/infinite_loops.rs:89:9
|
LL | / loop {
LL | |
LL | | do_something();
LL | | }
| |_________^
|
help: if this is intentional, consider specifing `!` as function return
|
LL | fn break_outer_but_not_inner() -> ! {
| ++++
error: infinite loop detected
--> $DIR/infinite_loops.rs:112:9
|
LL | / loop {
LL | |
LL | | 'inner: loop {
LL | | loop {
... |
LL | | }
LL | | }
| |_________^
|
help: if this is intentional, consider specifing `!` as function return
|
LL | fn break_wrong_loop(cond: bool) -> ! {
| ++++
error: infinite loop detected
--> $DIR/infinite_loops.rs:152:5
|
LL | / loop {
LL | |
LL | | match opt {
LL | | Some(v) => {
... |
LL | | }
LL | | }
| |_____^
|
help: if this is intentional, consider specifing `!` as function return
|
LL | fn match_like() -> ! {
| ++++
error: infinite loop detected
--> $DIR/infinite_loops.rs:193:5
|
LL | / loop {
LL | |
LL | | let _x = matches!(result, Ok(v) if v != 0).then_some(0);
LL | | }
| |_____^
|
help: if this is intentional, consider specifing `!` as function return
|
LL | fn match_like() -> ! {
| ++++
error: infinite loop detected
--> $DIR/infinite_loops.rs:198: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 specifing `!` as function return
|
LL | fn match_like() -> ! {
| ++++
error: aborting due to 9 previous errors