hv2-net::nat: clippy is red again on current stable (chunks_exact_to_as_chunks)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 73/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- rust
- Ambito
- build-system, testing
Direzione di ricerca
Inizia da crates/hv2-net/src/nat.rs, in internet_checksum, dove data.chunks_exact(2) attiva il lint segnalato. Controlla la toolchain stabile attuale con cargo clippy -p hv2-net --all-targets -- -D warnings, quindi rendi portabile la gestione del lint tra le versioni stabili. Il lavoro è completato quando il comando riesce sulle toolchain in cui il lint esiste e su quelle in cui non esiste.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Verifying #95's networking work (all four pieces: device, attach_net, guest driver, bridge) against current stable before treating it as done. Good news first, since it's the more important result:
The full chain works end to end
Ran the net_echo example against /dev/kvm (via WSL) -- the thing the handoff page flagged as "not run": a guest booted, its virtio-net driver came up, and a frame round-tripped through it.
guest : /tmp/hv2-unikernel/hv2-unikernel.elf
net : window at 0xd0020000, IRQ 6
guest driver : up in 7.4 ms
frame sent : 57 bytes
echo : 57 bytes back, addresses swapped
round trip : 2.3 ms
result : a frame crossed into a guest, through a driver with no allocator under it, and came back
Also independently reran and counted the unit tests the recent commits claim: 9 on virtio_net_mmio, 9 on VM::attach_net, 5 on hv2_net::bridge -- 23, matching. cargo fmt --all -- --check is clean.
But clippy is red on hv2-net right now
cargo clippy -p hv2-net --all-targets -- -D warnings (same command CI runs, per 11997dd's message) fails today:
error: using `chunks_exact` with a constant chunk size
--> crates\hv2-net\src\nat.rs:418:27
418 | let mut chunks = data.chunks_exact(2);
= note: `-D clippy::chunks-exact-to-as-chunks` implied by `-D warnings`
This is the same lint 11997dd removed the #[allow(...)] for, on the grounds that the attribute was itself unknown (unknown_lints) on the toolchain that session had. rust-toolchain.toml pins channel = "stable" -- a floating channel, not a fixed version -- so which lints exist under -D warnings depends on whenever rustup last updated. My local stable right now is 1.98.1 and it does recognize clippy::chunks_exact_to_as_chunks; whatever stable 11997dd's session had did not. Both sessions ran the identical command in good faith and got opposite answers, which is what a floating channel does.
The portable fix -- survives both directions of that drift -- is #[allow(unknown_lints, clippy::chunks_exact_to_as_chunks)] rather than the lint alone: unknown_lints swallows the "this isn't a real lint" complaint on an older toolchain, and the specific allow swallows the real one on a newer toolchain that has it.
#[allow(unknown_lints, clippy::chunks_exact_to_as_chunks)] // may not exist on every `stable`; unknown_lints covers that case too
fn internet_checksum(data: &[u8]) -> u16 {
Worth deciding separately, and out of scope for this issue: whether channel = "stable" should become a pinned version instead, so cargo clippy -D warnings gives the same verdict on every machine and in CI rather than depending on when each one last ran rustup update. This is the second time this exact class of drift has cost a red build over this one function.
- Lingua principale
- Rust
- Stelle
- 103
- Fork
- 3
- Merge medio
- 9h 56m
- PR unite (30g)
- 137
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di nervosys/HyperMachine
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
nervosys/HyperMachine#95 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di nervosys/HyperMachine
Issue simili
-
documentation priority:p2 type:chore
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
I maintainer di solito rispondono entro 1 giorno
-
dispatch:sol-high documentation
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
carrick-sh/carrick#768 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
correctness postgres tursopg
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
tursodatabase/turso#10442 ·
I maintainer di solito rispondono entro 1 giorno
-
Incorrect "Share Decks" linkAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
ankitects/anki#5864 · 1 reazione ·
I maintainer di solito rispondono entro 2 giorni
-
area: config effort: S good first issue P3 type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
ferenyl/azuredevopstui#63 ·