diff options
| author | Joe Richey <joerichey@google.com> | 2020-10-11 16:04:33 -0700 |
|---|---|---|
| committer | Joe Richey <joerichey@google.com> | 2020-10-22 22:03:13 -0700 |
| commit | 3807634a470b572303d95feb8a5db273c7cea4af (patch) | |
| tree | 962e0d816220f4277f6529f664e22911123160f6 /tests/ui | |
| parent | fbe75a84978c1cf7441f044bb4f80346602445c1 (diff) | |
clippy_lints: Update empty_loop lint
We also update the documentation to note that the remediations are different for `std` and `no_std` crates. Signed-off-by: Joe Richey <joerichey@google.com>
Diffstat (limited to 'tests/ui')
| -rw-r--r-- | tests/ui/crashes/ice-360.stderr | 3 | ||||
| -rw-r--r-- | tests/ui/empty_loop.stderr | 11 | ||||
| -rw-r--r-- | tests/ui/empty_loop_no_std.rs (renamed from tests/ui/issue-3746.rs) | 0 |
3 files changed, 10 insertions, 4 deletions
diff --git a/tests/ui/crashes/ice-360.stderr b/tests/ui/crashes/ice-360.stderr index 84e31eaf2e9..bb03ce40355 100644 --- a/tests/ui/crashes/ice-360.stderr +++ b/tests/ui/crashes/ice-360.stderr @@ -12,13 +12,14 @@ LL | | } | = note: `-D clippy::while-let-loop` implied by `-D warnings` -error: empty `loop {}` detected. You may want to either use `panic!()` or add `std::thread::sleep(..);` to the loop body. +error: empty `loop {}` wastes CPU cycles --> $DIR/ice-360.rs:10:9 | LL | loop {} | ^^^^^^^ | = note: `-D clippy::empty-loop` implied by `-D warnings` + = help: You should either use `panic!()` or add `std::thread::sleep(..);` to the loop body. error: aborting due to 2 previous errors diff --git a/tests/ui/empty_loop.stderr b/tests/ui/empty_loop.stderr index e44c58ea770..fd3979f259a 100644 --- a/tests/ui/empty_loop.stderr +++ b/tests/ui/empty_loop.stderr @@ -1,22 +1,27 @@ -error: empty `loop {}` detected. You may want to either use `panic!()` or add `std::thread::sleep(..);` to the loop body. +error: empty `loop {}` wastes CPU cycles --> $DIR/empty_loop.rs:9:5 | LL | loop {} | ^^^^^^^ | = note: `-D clippy::empty-loop` implied by `-D warnings` + = help: You should either use `panic!()` or add `std::thread::sleep(..);` to the loop body. -error: empty `loop {}` detected. You may want to either use `panic!()` or add `std::thread::sleep(..);` to the loop body. +error: empty `loop {}` wastes CPU cycles --> $DIR/empty_loop.rs:11:9 | LL | loop {} | ^^^^^^^ + | + = help: You should either use `panic!()` or add `std::thread::sleep(..);` to the loop body. -error: empty `loop {}` detected. You may want to either use `panic!()` or add `std::thread::sleep(..);` to the loop body. +error: empty `loop {}` wastes CPU cycles --> $DIR/empty_loop.rs:15:9 | LL | 'inner: loop {} | ^^^^^^^^^^^^^^^ + | + = help: You should either use `panic!()` or add `std::thread::sleep(..);` to the loop body. error: aborting due to 3 previous errors diff --git a/tests/ui/issue-3746.rs b/tests/ui/empty_loop_no_std.rs index 879d1d5d916..879d1d5d916 100644 --- a/tests/ui/issue-3746.rs +++ b/tests/ui/empty_loop_no_std.rs |
