Skip to content

Commit cc915cc

Browse files
Add missing ui annotations to new ui tests
1 parent a50953c commit cc915cc

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

tests/ui/unnecessary_map_or.fixed

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ fn with_deref(o: &S) -> bool {
125125

126126
fn issue14201(a: Option<String>, b: Option<String>, s: &String) -> bool {
127127
let x = a.is_some_and(|a| a == *s);
128+
//~^ unnecessary_map_or
128129
let y = b.is_none_or(|b| b == *s);
130+
//~^ unnecessary_map_or
129131
x && y
130132
}

tests/ui/unnecessary_map_or.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ fn with_deref(o: &S) -> bool {
129129

130130
fn issue14201(a: Option<String>, b: Option<String>, s: &String) -> bool {
131131
let x = a.map_or(false, |a| a == *s);
132+
//~^ unnecessary_map_or
132133
let y = b.map_or(true, |b| b == *s);
134+
//~^ unnecessary_map_or
133135
x && y
134136
}

tests/ui/unnecessary_map_or.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ LL + o.is_none_or(|n| n > 5)
290290
|
291291

292292
error: this `map_or` can be simplified
293-
--> tests/ui/unnecessary_map_or.rs:107:13
293+
--> tests/ui/unnecessary_map_or.rs:131:13
294294
|
295295
LL | let x = a.map_or(false, |a| a == *s);
296296
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -302,7 +302,7 @@ LL + let x = a.is_some_and(|a| a == *s);
302302
|
303303

304304
error: this `map_or` can be simplified
305-
--> tests/ui/unnecessary_map_or.rs:108:13
305+
--> tests/ui/unnecessary_map_or.rs:133:13
306306
|
307307
LL | let y = b.map_or(true, |b| b == *s);
308308
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/ui/{literal_string_with_formatting_args}.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//@check-pass
2+
13
// Regression test for <https://github.com/rust-lang/rust-clippy/issues/13885>.
24
// The `dbg` macro generates a literal with the name of the current file, so
35
// we need to ensure the lint is not emitted in this case.

0 commit comments

Comments
 (0)