for index for indices loop example issue
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- rust
- Ambito
- documentation
Direzione di ricerca
Start by reproducing the for_idx.rs snippet with the Rust version and compiler output reported in the issue. Review the intended index-loop example and its formatting, then update the example so it matches the supported Rust behavior and compiles without the reported errors.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
working with for .. index loop example.
$ rustc --version
rustc 1.12.0-nightly (9316ae515 2016-07-24)
$
fn print_all( all: Vec ){
for i in ..all.len() {
println!("{}: {}", i, all.get(i));
}
}
fn main() {
}
`
the compiler error seen is
for_idx.rs:4:2: 6:3 error: the trait bound std::ops::RangeTo<usize>: std::iter::Iterator is not satisfied [E0277]
for_idx.rs:4 for i in ..all.len() {
^
for_idx.rs:4:2: 6:3 help: run rustc --explain E0277 to see a detailed explanation
for_idx.rs:4:2: 6:3 note: std::ops::RangeTo<usize> is not an iterator; maybe try calling .iter() or a similar method
for_idx.rs:4:2: 6:3 note: required by std::iter::IntoIterator::into_iter
for_idx.rs:5:25: 5:35 error: the trait bound std::option::Option<&i32>: std::fmt::Display is not satisfied [E0277]
for_idx.rs:5 println!("{}: {}", i, all.get(i));
^~~~~~~~~~
:2:27: 2:58 note: in this expansion of format_args!
:3:1: 3:54 note: in this expansion of print! (defined in )
for_idx.rs:5:3: 5:37 note: in this expansion of println! (defined in )
for_idx.rs:5:25: 5:35 help: run rustc --explain E0277 to see a detailed explanation
for_idx.rs:5:25: 5:35 note: std::option::Option<&i32> cannot be formatted with the default formatter; try using :? instead if you are using a format string
for_idx.rs:5:25: 5:35 note: required by std::fmt::Display::fmt
error: aborting due to 2 previous errors
- Lingua principale
- Rust
- Stelle
- 3.9k
- Fork
- 297
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
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 nrc/r4cppp
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
-
make_unique call typoAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
-
Problem with "primitives.md"Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 38/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 42/100
Issue simili
-
C-bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
rust-lang/rust-analyzer#23501 ·
I maintainer di solito rispondono entro 1 giorno
-
Streamable HTTP client: a 401 or 403 with a JSON-RPC error body and no WWW-Authenticate loses its HTTP statusForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug P2 ready for work T-security T-transport
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
modelcontextprotocol/rust-sdk#1339 ·
I maintainer di solito rispondono entro 3 giorni
-
scripts/gen-gallery.py:118: a ready session now reports in_progress, so SESSION_READY_OLD can goApertanightly-audit
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
antithesishq/snouty#396 ·
I maintainer di solito rispondono entro 1 giorno
-
French BIP39 wordlist starts with a UTF-8 BOM, so generated French mnemonics carry U+FEFF and derive a non-canonical seedForse già presa @Kshot3000 l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 91/100
ergoplatform/sigma-rust#976 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno