Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
27be5c2
docs(core): update `find()` and `rfind()` examples
smirzaei Dec 22, 2025
a6b005a
fix `Expr::can_have_side_effects` for repeat and binary expressions
andjsrk Dec 26, 2025
8ca47cd
Clarify `MoveData::init_loc_map`.
nnethercote Jan 1, 2026
bd5526c
accept test changes related to binary ops
andjsrk Jan 6, 2026
021a551
add test for repeats
andjsrk Jan 6, 2026
61ca012
rename test
andjsrk Jan 6, 2026
f805d1b
format
andjsrk Jan 6, 2026
c73b64b
update expected output as well
andjsrk Jan 6, 2026
d848437
add more information in comment
andjsrk Jan 7, 2026
ea7ada9
Update browser-ui-test version to `0.23.1`
GuillaumeGomez Jan 7, 2026
d411919
rename the `derive_{eq, clone_copy}` features to `*_internals`
cyrgani Jan 8, 2026
6ed9530
tests/ui/borrowck/issue-92157.rs: Remove (bug not fixed)
Enselic Jan 8, 2026
8e3d604
Finish transition from `semitransparent` to `semiopaque` for `rustc_m…
Enselic Jan 1, 2026
9e00663
rust-analyzer: Also use `semiopaque` instead of `semitransparent`
Enselic Jan 1, 2026
742d276
make attrs actually use `Target::GenericParam`
Bryntet Jan 8, 2026
c502d7f
Fix trait method anchor disappearing before user can click on it
GuillaumeGomez Jan 8, 2026
bfb117a
Clean up `tests/rustdoc-gui/anchors.goml` test code
GuillaumeGomez Jan 8, 2026
16fbf6a
Add check for trait impl method anchor
GuillaumeGomez Jan 8, 2026
945e7c7
Use functions more in rustdoc GUI tests
GuillaumeGomez Jan 7, 2026
5466c6b
Move feature(multiple_supertrait_upcastable) to the actual feature ga…
zachs18 Jan 8, 2026
561b592
add test for binary ops
andjsrk Jan 9, 2026
025ac8f
The aarch64-unknown-none target requires NEON, so the docs were wrong.
jonathanpallant Jan 9, 2026
2ce7a5d
Rollup merge of #150272 - doc/improve-iter-find-docs, r=scottmcm
GuillaumeGomez Jan 9, 2026
09575ec
Rollup merge of #150385 - fix-expr-can-have-side-effects, r=jdonszelm…
GuillaumeGomez Jan 9, 2026
3daf993
Rollup merge of #150561 - semiopaque, r=BoxyUwU
GuillaumeGomez Jan 9, 2026
7702fb2
Rollup merge of #150574 - MoveData-init_loc_map, r=cjgillot
GuillaumeGomez Jan 9, 2026
10e24f1
Rollup merge of #150762 - cleanup-gui, r=lolbinarycat
GuillaumeGomez Jan 9, 2026
e99f5f6
Rollup merge of #150808 - derive-internals, r=jhpratt
GuillaumeGomez Jan 9, 2026
fe307c5
Rollup merge of #150816 - method-anchor, r=camelid
GuillaumeGomez Jan 9, 2026
19769da
Rollup merge of #150821 - remove-test, r=jackh726
GuillaumeGomez Jan 9, 2026
0548617
Rollup merge of #150829 - fix_generic_param_target, r=JonathanBrouwer
GuillaumeGomez Jan 9, 2026
ab854da
Rollup merge of #150834 - multiple_supertrait_upcastable-not-internal…
GuillaumeGomez Jan 9, 2026
8f89503
Rollup merge of #150864 - fix-aarch64-platform-docs, r=jdonszelmann
GuillaumeGomez Jan 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
accept test changes related to binary ops
  • Loading branch information
andjsrk committed Jan 6, 2026
commit bd5526c2cf7a040d96ef7c41fce8b9f0ca6b9374
3 changes: 2 additions & 1 deletion src/tools/clippy/tests/ui/manual_clamp.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
dead_code,
clippy::unnecessary_operation,
clippy::no_effect,
clippy::if_same_then_else
clippy::if_same_then_else,
clippy::needless_match
)]

use std::cmp::{max as cmp_max, min as cmp_min};
Expand Down
3 changes: 2 additions & 1 deletion src/tools/clippy/tests/ui/manual_clamp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
dead_code,
clippy::unnecessary_operation,
clippy::no_effect,
clippy::if_same_then_else
clippy::if_same_then_else,
clippy::needless_match
)]

use std::cmp::{max as cmp_max, min as cmp_min};
Expand Down
70 changes: 35 additions & 35 deletions src/tools/clippy/tests/ui/manual_clamp.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:212:5
--> tests/ui/manual_clamp.rs:213:5
|
LL | / if x9 < CONST_MIN {
LL | |
Expand All @@ -15,7 +15,7 @@ LL | | }
= help: to override `-D warnings` add `#[allow(clippy::manual_clamp)]`

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:230:5
--> tests/ui/manual_clamp.rs:231:5
|
LL | / if x11 > CONST_MAX {
LL | |
Expand All @@ -29,7 +29,7 @@ LL | | }
= note: clamp will panic if max < min

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:240:5
--> tests/ui/manual_clamp.rs:241:5
|
LL | / if CONST_MIN > x12 {
LL | |
Expand All @@ -43,7 +43,7 @@ LL | | }
= note: clamp will panic if max < min

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:250:5
--> tests/ui/manual_clamp.rs:251:5
|
LL | / if CONST_MAX < x13 {
LL | |
Expand All @@ -57,7 +57,7 @@ LL | | }
= note: clamp will panic if max < min

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:363:5
--> tests/ui/manual_clamp.rs:364:5
|
LL | / if CONST_MAX < x35 {
LL | |
Expand All @@ -71,7 +71,7 @@ LL | | }
= note: clamp will panic if max < min

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:144:14
--> tests/ui/manual_clamp.rs:145:14
|
LL | let x0 = if CONST_MAX < input {
| ______________^
Expand All @@ -86,7 +86,7 @@ LL | | };
= note: clamp will panic if max < min

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:154:14
--> tests/ui/manual_clamp.rs:155:14
|
LL | let x1 = if input > CONST_MAX {
| ______________^
Expand All @@ -101,7 +101,7 @@ LL | | };
= note: clamp will panic if max < min

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:164:14
--> tests/ui/manual_clamp.rs:165:14
|
LL | let x2 = if input < CONST_MIN {
| ______________^
Expand All @@ -116,7 +116,7 @@ LL | | };
= note: clamp will panic if max < min

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:174:14
--> tests/ui/manual_clamp.rs:175:14
|
LL | let x3 = if CONST_MIN > input {
| ______________^
Expand All @@ -131,23 +131,23 @@ LL | | };
= note: clamp will panic if max < min

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:184:14
--> tests/ui/manual_clamp.rs:185:14
|
LL | let x4 = input.max(CONST_MIN).min(CONST_MAX);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)`
|
= note: clamp will panic if max < min

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:187:14
--> tests/ui/manual_clamp.rs:188:14
|
LL | let x5 = input.min(CONST_MAX).max(CONST_MIN);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)`
|
= note: clamp will panic if max < min

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:190:14
--> tests/ui/manual_clamp.rs:191:14
|
LL | let x6 = match input {
| ______________^
Expand All @@ -161,7 +161,7 @@ LL | | };
= note: clamp will panic if max < min

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:197:14
--> tests/ui/manual_clamp.rs:198:14
|
LL | let x7 = match input {
| ______________^
Expand All @@ -175,7 +175,7 @@ LL | | };
= note: clamp will panic if max < min

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:204:14
--> tests/ui/manual_clamp.rs:205:14
|
LL | let x8 = match input {
| ______________^
Expand All @@ -189,7 +189,7 @@ LL | | };
= note: clamp will panic if max < min

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:221:15
--> tests/ui/manual_clamp.rs:222:15
|
LL | let x10 = match input {
| _______________^
Expand All @@ -203,7 +203,7 @@ LL | | };
= note: clamp will panic if max < min

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:259:15
--> tests/ui/manual_clamp.rs:260:15
|
LL | let x14 = if input > CONST_MAX {
| _______________^
Expand All @@ -218,7 +218,7 @@ LL | | };
= note: clamp will panic if max < min

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:270:19
--> tests/ui/manual_clamp.rs:271:19
|
LL | let x15 = if input > CONST_F64_MAX {
| ___________________^
Expand All @@ -234,71 +234,71 @@ LL | | };
= note: clamp returns NaN if the input is NaN

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:283:19
--> tests/ui/manual_clamp.rs:284:19
|
LL | let x16 = cmp_max(cmp_min(input, CONST_MAX), CONST_MIN);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)`
|
= note: clamp will panic if max < min

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:286:19
--> tests/ui/manual_clamp.rs:287:19
|
LL | let x17 = cmp_min(cmp_max(input, CONST_MIN), CONST_MAX);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)`
|
= note: clamp will panic if max < min

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:289:19
--> tests/ui/manual_clamp.rs:290:19
|
LL | let x18 = cmp_max(CONST_MIN, cmp_min(input, CONST_MAX));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)`
|
= note: clamp will panic if max < min

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:292:19
--> tests/ui/manual_clamp.rs:293:19
|
LL | let x19 = cmp_min(CONST_MAX, cmp_max(input, CONST_MIN));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)`
|
= note: clamp will panic if max < min

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:295:19
--> tests/ui/manual_clamp.rs:296:19
|
LL | let x20 = cmp_max(cmp_min(CONST_MAX, input), CONST_MIN);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)`
|
= note: clamp will panic if max < min

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:298:19
--> tests/ui/manual_clamp.rs:299:19
|
LL | let x21 = cmp_min(cmp_max(CONST_MIN, input), CONST_MAX);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)`
|
= note: clamp will panic if max < min

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:301:19
--> tests/ui/manual_clamp.rs:302:19
|
LL | let x22 = cmp_max(CONST_MIN, cmp_min(CONST_MAX, input));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)`
|
= note: clamp will panic if max < min

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:304:19
--> tests/ui/manual_clamp.rs:305:19
|
LL | let x23 = cmp_min(CONST_MAX, cmp_max(CONST_MIN, input));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_MIN, CONST_MAX)`
|
= note: clamp will panic if max < min

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:308:19
--> tests/ui/manual_clamp.rs:309:19
|
LL | let x24 = f64::max(f64::min(input, CONST_F64_MAX), CONST_F64_MIN);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_F64_MIN, CONST_F64_MAX)`
Expand All @@ -307,7 +307,7 @@ LL | let x24 = f64::max(f64::min(input, CONST_F64_MAX), CONST_F64_MIN);
= note: clamp returns NaN if the input is NaN

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:311:19
--> tests/ui/manual_clamp.rs:312:19
|
LL | let x25 = f64::min(f64::max(input, CONST_F64_MIN), CONST_F64_MAX);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_F64_MIN, CONST_F64_MAX)`
Expand All @@ -316,7 +316,7 @@ LL | let x25 = f64::min(f64::max(input, CONST_F64_MIN), CONST_F64_MAX);
= note: clamp returns NaN if the input is NaN

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:314:19
--> tests/ui/manual_clamp.rs:315:19
|
LL | let x26 = f64::max(CONST_F64_MIN, f64::min(input, CONST_F64_MAX));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_F64_MIN, CONST_F64_MAX)`
Expand All @@ -325,7 +325,7 @@ LL | let x26 = f64::max(CONST_F64_MIN, f64::min(input, CONST_F64_MAX));
= note: clamp returns NaN if the input is NaN

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:317:19
--> tests/ui/manual_clamp.rs:318:19
|
LL | let x27 = f64::min(CONST_F64_MAX, f64::max(input, CONST_F64_MIN));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_F64_MIN, CONST_F64_MAX)`
Expand All @@ -334,7 +334,7 @@ LL | let x27 = f64::min(CONST_F64_MAX, f64::max(input, CONST_F64_MIN));
= note: clamp returns NaN if the input is NaN

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:320:19
--> tests/ui/manual_clamp.rs:321:19
|
LL | let x28 = f64::max(f64::min(CONST_F64_MAX, input), CONST_F64_MIN);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_F64_MIN, CONST_F64_MAX)`
Expand All @@ -343,7 +343,7 @@ LL | let x28 = f64::max(f64::min(CONST_F64_MAX, input), CONST_F64_MIN);
= note: clamp returns NaN if the input is NaN

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:323:19
--> tests/ui/manual_clamp.rs:324:19
|
LL | let x29 = f64::min(f64::max(CONST_F64_MIN, input), CONST_F64_MAX);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_F64_MIN, CONST_F64_MAX)`
Expand All @@ -352,7 +352,7 @@ LL | let x29 = f64::min(f64::max(CONST_F64_MIN, input), CONST_F64_MAX);
= note: clamp returns NaN if the input is NaN

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:326:19
--> tests/ui/manual_clamp.rs:327:19
|
LL | let x30 = f64::max(CONST_F64_MIN, f64::min(CONST_F64_MAX, input));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_F64_MIN, CONST_F64_MAX)`
Expand All @@ -361,7 +361,7 @@ LL | let x30 = f64::max(CONST_F64_MIN, f64::min(CONST_F64_MAX, input));
= note: clamp returns NaN if the input is NaN

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:329:19
--> tests/ui/manual_clamp.rs:330:19
|
LL | let x31 = f64::min(CONST_F64_MAX, f64::max(CONST_F64_MIN, input));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `input.clamp(CONST_F64_MIN, CONST_F64_MAX)`
Expand All @@ -370,7 +370,7 @@ LL | let x31 = f64::min(CONST_F64_MAX, f64::max(CONST_F64_MIN, input));
= note: clamp returns NaN if the input is NaN

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:333:5
--> tests/ui/manual_clamp.rs:334:5
|
LL | / if x32 < CONST_MIN {
LL | |
Expand All @@ -384,7 +384,7 @@ LL | | }
= note: clamp will panic if max < min

error: clamp-like pattern without using clamp function
--> tests/ui/manual_clamp.rs:525:13
--> tests/ui/manual_clamp.rs:526:13
|
LL | let _ = if input > CONST_MAX {
| _____________^
Expand Down
4 changes: 3 additions & 1 deletion src/tools/clippy/tests/ui/needless_bitwise_bool.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ fn main() {
println!("true") // This is a const method call
}

if y & (0 < 1) {
// Resolved
if y && (0 < 1) {
//~^ needless_bitwise_bool
println!("true") // This is a BinOp with no side effects
}
}
2 changes: 2 additions & 0 deletions src/tools/clippy/tests/ui/needless_bitwise_bool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ fn main() {
println!("true") // This is a const method call
}

// Resolved
if y & (0 < 1) {
//~^ needless_bitwise_bool
println!("true") // This is a BinOp with no side effects
}
}
8 changes: 7 additions & 1 deletion src/tools/clippy/tests/ui/needless_bitwise_bool.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,11 @@ LL | if y & !x {
= note: `-D clippy::needless-bitwise-bool` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::needless_bitwise_bool)]`

error: aborting due to 1 previous error
error: use of bitwise operator instead of lazy operator between booleans
--> tests/ui/needless_bitwise_bool.rs:38:8
|
LL | if y & (0 < 1) {
| ^^^^^^^^^^^ help: try: `y && (0 < 1)`

error: aborting due to 2 previous errors

Loading