Skip to content

Commit cf46d21

Browse files
committed
Begin removing/disabling wildcard imports.
This starts with the "core" code in sys, test, and jefe, and works out from there. Any package can opt into this at any time by adding this to its Cargo.toml: [lints] workspace = true This will also cause it to pick up any future lints we decide on.
1 parent 875a07a commit cf46d21

File tree

25 files changed

+174
-98
lines changed

25 files changed

+174
-98
lines changed

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,6 @@ tlvc = { git = "https://github.com/oxidecomputer/tlvc", default-features = false
135135
tlvc-text = { git = "https://github.com/oxidecomputer/tlvc", default-features = false, version = "0.3.0" }
136136
transceiver-messages = { git = "https://github.com/oxidecomputer/transceiver-control/", default-features = false}
137137
vsc7448-pac = { git = "https://github.com/oxidecomputer/vsc7448", default-features = false }
138+
139+
[workspace.lints.clippy]
140+
wildcard_imports = "deny"

lib/multitimer/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ enum-map = { workspace = true }
88

99
[target.'cfg(target_os = "none")'.dependencies]
1010
userlib = {path = "../../sys/userlib"}
11+
12+
[lints]
13+
workspace = true

lib/multitimer/src/lib.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ mod fakes {
213213
use core::cell::Cell;
214214

215215
thread_local! {
216-
pub static CURRENT_TIME: Cell<u64> = Cell::new(0);
217-
pub static TIMER_SETTING: Cell<(Option<u64>, u32)> = Cell::default();
216+
pub static CURRENT_TIME: Cell<u64> = const { Cell::new(0) };
217+
pub static TIMER_SETTING: Cell<(Option<u64>, u32)> = const { Cell::new((None, 0)) };
218218
}
219219

220220
pub fn sys_set_timer(deadline: Option<u64>, not: u32) {
@@ -239,11 +239,14 @@ mod fakes {
239239
}
240240
}
241241
#[cfg(not(target_os = "none"))]
242-
use self::fakes::*;
242+
use self::fakes::{sys_get_timer, sys_set_timer};
243243

244244
#[cfg(test)]
245245
mod tests {
246-
use super::*;
246+
use super::{
247+
fakes, sys_get_timer, sys_set_timer, EnumArray, EnumMap, Multitimer,
248+
Repeat, Timer,
249+
};
247250

248251
fn change_time(time: u64) {
249252
CURRENT_TIME.with(|t| t.set(time));

sys/abi/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ bitflags = { workspace = true }
99
byteorder = { workspace = true }
1010
serde = { workspace = true }
1111
phash = { path = "../../lib/phash" }
12+
13+
[lints]
14+
workspace = true

sys/kern/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,6 @@ nano = []
4141
test = false
4242
doctest = false
4343
bench = false
44+
45+
[lints]
46+
workspace = true

sys/kern/src/startup.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//! Kernel startup.
66
77
use crate::atomic::AtomicExt;
8-
use crate::descs::*;
8+
use crate::descs::{RegionAttributes, RegionDesc, TaskDesc, TaskFlags};
99
use crate::task::Task;
1010
use core::mem::MaybeUninit;
1111
use core::sync::atomic::{AtomicBool, Ordering};

sys/kerncore/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ edition = "2021"
66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

88
[dependencies]
9+
10+
[lints]
11+
workspace = true

sys/num-tasks/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ task-enum = []
1313
test = false
1414
doctest = false
1515
bench = false
16+
17+
[lints]
18+
workspace = true

sys/userlib/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,6 @@ build-util = { path = "../../build/util" }
5151
test = false
5252
doctest = false
5353
bench = false
54+
55+
[lints]
56+
workspace = true

task/jefe/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,6 @@ name = "task-jefe"
3939
test = false
4040
doctest = false
4141
bench = false
42+
43+
[lints]
44+
workspace = true

0 commit comments

Comments
 (0)