Skip to content

Commit 5f1184c

Browse files
committed
Merge branch '🚨-clippy' into 🦆
2 parents cabbc02 + 47cad1f commit 5f1184c

File tree

30 files changed

+346
-104
lines changed

30 files changed

+346
-104
lines changed

‎.github/workflows/ci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ jobs:
2727
sudo apt-get update
2828
sudo apt-get install libusb-1.0-0-dev libudev-dev
2929
30+
- name: Allow `incomplete_features`
31+
run: |
32+
echo "RUSTFLAGS=-A incomplete_features" >> $GITHUB_ENV
33+
3034
- name: Exclude crates
3135
run: |
3236
# Example crates will fail to compile unless an appropriate target
@@ -85,6 +89,10 @@ jobs:
8589
rustup target add thumbv6m-none-eabi thumbv7em-none-eabihf
8690
rustup target add armv7a-none-eabi
8791
92+
- name: Allow `incomplete_features`
93+
run: |
94+
echo "RUSTFLAGS=-A incomplete_features" >> $GITHUB_ENV
95+
8896
- name: Build examples
8997
shell: bash
9098
run: |
@@ -129,6 +137,10 @@ jobs:
129137
if: "!startsWith(matrix.os, 'ubuntu-')"
130138
run: echo "testflags=--test-threads=1" >> $GITHUB_ENV
131139

140+
- name: Allow `incomplete_features`
141+
run: |
142+
echo "RUSTFLAGS=-A incomplete_features" >> $GITHUB_ENV
143+
132144
- name: Exclude crates
133145
shell: bash
134146
run: |
@@ -171,6 +183,10 @@ jobs:
171183
sudo apt-get update
172184
sudo apt-get install libusb-1.0-0-dev libudev-dev
173185
186+
- name: Allow `incomplete_features`
187+
run: |
188+
echo "RUSTFLAGS=-A incomplete_features" >> $GITHUB_ENV
189+
174190
- name: Convert feature list to Cargo parameter
175191
run: |
176192
features='${{ matrix.features }}'

‎Cargo.lock

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,11 @@ git = "https://github.com/r3-os/rust-riscv-rt.git"
6060
branch = "refresh/0.8"
6161
version = "0.6.2"
6262

63+
[patch.crates-io.memoffset]
64+
# FIXME: Waiting for the fix for false clippy warnings
65+
# <https://github.com/Gilnaa/memoffset/pull/64> to be published to crates.io
66+
git = "https://github.com/Gilnaa/memoffset.git"
67+
rev = "2a74b62c26724ff9c67e4e3ad05378a1af53f195"
68+
6369
[profile.release]
6470
debug = true

‎examples/basic/src/main.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
#![feature(const_mut_refs)]
66
#![deny(unsafe_op_in_unsafe_fn)]
77
use r3::{
8-
kernel::{prelude::*, traits, StaticTask},
9-
prelude::*,
8+
kernel::{prelude::*, StaticTask},
109
sync::StaticMutex,
1110
};
1211

@@ -15,9 +14,9 @@ r3_port_std::use_port!(unsafe struct SystemTraits);
1514

1615
#[derive(Debug)]
1716
struct Objects {
18-
task1: StaticTask<System>,
17+
_task1: StaticTask<System>,
1918
task2: StaticTask<System>,
20-
mutex1: StaticMutex<System, u32>,
19+
_mutex1: StaticMutex<System, u32>,
2120
}
2221

2322
const COTTAGE: Objects = r3_kernel::build!(SystemTraits, configure_app => Objects);
@@ -35,9 +34,9 @@ const fn configure_app(b: &mut r3_kernel::Cfg<'_, SystemTraits>) -> Objects {
3534
let mutex1 = StaticMutex::define().finish(b);
3635

3736
Objects {
38-
task1,
37+
_task1: task1,
3938
task2,
40-
mutex1,
39+
_mutex1: mutex1,
4140
}
4241
}
4342

‎examples/basic_nucleo_f401re/src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ impl port::SysTickOptions for SystemTraits {
3535

3636
#[derive(Debug)]
3737
struct Objects {
38-
task1: StaticTask<System>,
38+
_task1: StaticTask<System>,
3939
task2: StaticTask<System>,
40-
mutex1: StaticMutex<System, u32>,
40+
_mutex1: StaticMutex<System, u32>,
4141
}
4242

4343
const COTTAGE: Objects = r3_kernel::build!(SystemTraits, configure_app => Objects);
@@ -65,9 +65,9 @@ const fn configure_app(b: &mut r3_kernel::Cfg<SystemTraits>) -> Objects {
6565
let mutex1 = StaticMutex::define().finish(b);
6666

6767
Objects {
68-
task1,
68+
_task1: task1,
6969
task2,
70-
mutex1,
70+
_mutex1: mutex1,
7171
}
7272
}
7373

‎src/arm_semihosting/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
//! [pdf]: http://infocenter.arm.com/help/topic/com.arm.doc.dui0471e/DUI0471E_developing_for_arm_processors.pdf
4646
4747
#![deny(missing_docs)]
48+
#![allow(clippy::missing_safety_doc)]
49+
#![allow(clippy::result_unit_err)]
4850
#![no_std]
4951

5052
#[macro_use]

‎src/r3_core/src/bind.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,7 @@ macro_rules! impl_unzip_bind_for_tuples {
766766

767767
fn unzip(self) -> Self::Target {
768768
#[allow(unused_unsafe)] // for `Bind<'_, _, ()>`
769+
#[allow(clippy::unused_unit)] // for `Bind<'_, _, ()>`
769770
unsafe {
770771
let divide = DivideBind::new(self);
771772
let hunk = divide.original_hunk();
@@ -900,10 +901,12 @@ impl CfgBindRegistry {
900901
// [tag:bind_finalization_immediate_panic] The errors are
901902
// reported by panicking immediately for now
902903
match e {
903-
sorter::SorterError::BindCycle { bind_is: _ } => {
904+
sorter::SorterError::BindCycle { bind_is } => {
905+
let _ = bind_is; // TODO: Display the bindings' names
904906
panic!("the binding initialization order contains a cycle");
905907
}
906-
sorter::SorterError::ConflictingIndefiniteBorrow { bind_i: _ } => {
908+
sorter::SorterError::ConflictingIndefiniteBorrow { bind_i } => {
909+
let _ = bind_i; // TODO: Display the binding's name
907910
panic!("conflicting indefinite borrows");
908911
}
909912
}
@@ -1734,6 +1737,7 @@ macro_rules! impl_binder_on_tuples {
17341737
let _ = ctx;
17351738
}
17361739

1740+
#[allow(clippy::unused_unit)]
17371741
fn into_runtime_binder(self) -> Self::Runtime {
17381742
( $( self.$I.into_runtime_binder(), )* )
17391743
}
@@ -1747,6 +1751,7 @@ macro_rules! impl_binder_on_tuples {
17471751

17481752
#[allow(unused_unsafe)]
17491753
#[allow(unused_variables)]
1754+
#[allow(clippy::unused_unit)]
17501755
#[inline]
17511756
unsafe fn materialize<'call>(self) -> Self::Target<'call> {
17521757
unsafe {

‎src/r3_core/src/hunk.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ impl<System: raw::KernelBase + cfg::KernelStatic, T: ?Sized> Hunk<System, T> {
298298

299299
/// Get a reference to the hunk's contents.
300300
#[inline]
301+
#[allow(clippy::should_implement_trait)]
301302
pub fn as_ref<'a>(this: Self) -> &'a T
302303
where
303304
T: 'a,

‎src/r3_core/src/kernel/event_group.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ impl<System: raw::KernelEventGroup> EventGroupDefiner<System> {
161161
initial_bits: initial,
162162
..self.inner
163163
},
164-
..self
165164
}
166165
}
167166

@@ -172,10 +171,9 @@ impl<System: raw::KernelEventGroup> EventGroupDefiner<System> {
172171
pub const fn queue_order(self, queue_order: raw::QueueOrder) -> Self {
173172
Self {
174173
inner: raw_cfg::EventGroupDescriptor {
175-
queue_order: queue_order,
174+
queue_order,
176175
..self.inner
177176
},
178-
..self
179177
}
180178
}
181179

0 commit comments

Comments
 (0)