mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
Add ui test
This commit is contained in:
parent
f4f31a4ff4
commit
72e4e4ac6c
5
tests/ui/suspicious_map.rs
Normal file
5
tests/ui/suspicious_map.rs
Normal file
@ -0,0 +1,5 @@
|
||||
#![warn(clippy::suspicious_map)]
|
||||
|
||||
fn main() {
|
||||
let _ = (0..3).map(|x| x + 2).count();
|
||||
}
|
10
tests/ui/suspicious_map.stderr
Normal file
10
tests/ui/suspicious_map.stderr
Normal file
@ -0,0 +1,10 @@
|
||||
error: Make sure you did not confuse `map` with `filter`.
|
||||
--> $DIR/suspicious_map.rs:4:13
|
||||
|
|
||||
LL | let _ = (0..3).map(|x| x + 2).count();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D clippy::suspicious-map` implied by `-D warnings`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
Loading…
Reference in New Issue
Block a user