Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

ml-kem/module-lattice: `integer_extend_truncate` warnings

Aperta
#308 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
rust
Ambito
cryptography

Direzione di ricerca

Inizia in ml-kem/src/algebra.rs intorno alla riga 123 e ispeziona il trait Truncate e il suo utilizzo, quindi controlla gli attributi del crate in ml-kem/src/lib.rs. Risolvi l'avviso senza fare affidamento su un nome che potrebbe entrare in conflitto con la libreria standard; il lavoro è terminato quando l'avviso è scomparso e l'API scelta rimane chiara.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Just started getting these warnings:

warning: an associated function with this name may be added to the standard library in the future
   --> ml-kem/src/algebra.rs:123:27
    |
123 |         let N = start_n + u8::truncate(i);
    |                           ^^^^^^^^^^^^
    |
    = help: call with fully qualified syntax `truncate(...)` to keep using the current method
    = warning: once this associated item is added to the standard library, the ambiguity may cause an error or change in behavior!
    = note: for more information, see issue #48919 <https://github.com/rust-lang/rust/issues/48919>
    = note: `#[warn(unstable_name_collisions)]` (part of `#[warn(future_incompatible)]`) on by default
help: add `#![feature(integer_extend_truncate)]` to the crate attributes to enable `core::num::<impl u8>::truncate`
   --> ml-kem/src/lib.rs:45:1
    |
 45 + #![feature(integer_extend_truncate)]

It seems we should at least switch to using Truncate::truncate as the invocation syntax, but also this seems like a case where we should perhaps consider a different API entirely, or at least a different method name, so as not to clash with the standard library.

Lingua principale
Rust
Stelle
111
Fork
53
Merge medio
5g 29m
PR unite (30g)
2

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di RustCrypto/KEMs

Tutte le issue di RustCrypto/KEMs

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.