Skip to content

Commit 034d773

Browse files
committed
refactor(test_suite): ignore the clippy::needless_range_loop lint
1 parent 0408109 commit 034d773

File tree

5 files changed

+14
-0
lines changed

5 files changed

+14
-0
lines changed

src/r3_test_suite/src/kernel_benchmarks/timer_start.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ impl<System: SupportedSystem> AppInner<System> {
4343

4444
// `[T]::iter_mut` is unusable in `const fn` [ref:const_slice_iter]
4545
// `core::array::from_fn` is not `const fn` [ref:const_array_from_fn]
46+
// FIXME: `needless_range_loop` false positive
47+
// <https://github.com/rust-lang/rust-clippy/issues/10524>
48+
#[expect(clippy::needless_range_loop)]
4649
for i in 0..timers.len() {
4750
timers[i] = MaybeUninit::new(StaticTimer::define().start(|| {}).finish(b));
4851
}

src/r3_test_suite/src/kernel_tests/compute_atomics_round_robin.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ impl<System: SupportedSystem> App<System> {
145145

146146
// `[T]::iter_mut` is unusable in `const fn` [ref:const_slice_iter]
147147
// `core::array::from_fn` is not `const fn` [ref:const_array_from_fn]
148+
// FIXME: `needless_range_loop` false positive
149+
// <https://github.com/rust-lang/rust-clippy/issues/10524>
150+
#[expect(clippy::needless_range_loop)]
148151
for i in 0..NUM_TASKS {
149152
tasks[i] = Some(
150153
StaticTask::define()

src/r3_test_suite/src/kernel_tests/compute_round_robin.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ impl<System: SupportedSystem> App<System> {
6565

6666
// `[T]::iter_mut` is unusable in `const fn` [ref:const_slice_iter]
6767
// `core::array::from_fn` is not `const fn` [ref:const_array_from_fn]
68+
// FIXME: `needless_range_loop` false positive
69+
// <https://github.com/rust-lang/rust-clippy/issues/10524>
70+
#[expect(clippy::needless_range_loop)]
6871
for i in 0..NUM_TASKS {
6972
let task_state = if i == 0 {
7073
// Reuse the storage

src/r3_test_suite/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#![feature(assert_matches)]
1313
#![feature(array_windows)]
1414
#![feature(const_option)]
15+
#![feature(lint_reasons)]
1516
#![feature(cell_update)]
1617
#![feature(const_iter)]
1718
#![feature(decl_macro)]

src/r3_test_suite/src/utils/trig.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ pub const fn sincos(theta: f64) -> (f64, f64) {
4646
let mut x = 1.0;
4747
let mut y = 0.0;
4848

49+
// `[T]::iter` is unusable in `const fn` [ref:const_slice_iter]
50+
// FIXME: `needless_range_loop` false positive
51+
// <https://github.com/rust-lang/rust-clippy/issues/10524>
52+
#[expect(clippy::needless_range_loop)]
4953
for i in 0..32 {
5054
if (theta_i & (1u32 << i)) != 0 {
5155
let (x2, y2) = (x, y);

0 commit comments

Comments
 (0)