diff options
| author | bors <bors@rust-lang.org> | 2023-01-12 20:05:18 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-01-12 20:05:18 +0000 |
| commit | 61a415be590113b4935464ef0aaf3b4e7713a077 (patch) | |
| tree | c743bcfc04170cf8b2dcb171cb8805e76683190e /src/tools/clippy/tests/ui/single_element_loop.stderr | |
| parent | 1bc3683b3275a5eb2ed13d24edcdcbc59afe5d70 (diff) | |
| parent | 01c75848eb94e96210e74b8dd43a5a270464ac25 (diff) | |
Auto merge of #106780 - flip1995:clippyup, r=Manishearth
Update Clippy r? `@Manishearth`
Diffstat (limited to 'src/tools/clippy/tests/ui/single_element_loop.stderr')
| -rw-r--r-- | src/tools/clippy/tests/ui/single_element_loop.stderr | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/tools/clippy/tests/ui/single_element_loop.stderr b/src/tools/clippy/tests/ui/single_element_loop.stderr index 0aeb8da1a2e..14437a59745 100644 --- a/src/tools/clippy/tests/ui/single_element_loop.stderr +++ b/src/tools/clippy/tests/ui/single_element_loop.stderr @@ -95,5 +95,32 @@ LL + dbg!(item); LL + } | -error: aborting due to 6 previous errors +error: for loop over a single element + --> $DIR/single_element_loop.rs:46:5 + | +LL | / for _ in [42] { +LL | | let _f = |n: u32| { +LL | | for i in 0..n { +LL | | if i > 10 { +... | +LL | | }; +LL | | } + | |_____^ + | +help: try + | +LL ~ { +LL + let _ = 42; +LL + let _f = |n: u32| { +LL + for i in 0..n { +LL + if i > 10 { +LL + dbg!(i); +LL + break; +LL + } +LL + } +LL + }; +LL + } + | + +error: aborting due to 7 previous errors |
