Use references for scalar operands
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start by tracing the ops macros and the ScalarOperand and StaticOperand implementations mentioned in the issue, then reproduce the array-plus-referenced-scalar example. Investigate the conflicting implementation error and existing operand combinations. Done means the example compiles while existing array operation behavior remains supported.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
It would be useful for me to be able to use references to scalars instead of owned instances when performing operations on arrays.
e.g., this fails:
let arr1 = array!([1, 2, 3]);
let four: i32 = 4;
let arr2 = arr1 + &four; //error
I naively tried modifying the ops macros to accept references but kept getting a conflicting implementation error. It seems that the compiler is worried that someone will come along an add an implementation to StaticOperand for reference types:
= note: downstream crates may implement trait `impl_ops::ScalarOperand` for type `&_`
...which is strange because there's a 'static type bound on ScalarOperand?
In any case, if anyone has any guidance on how to proceed, I'd greatly appreciate it! I'm happy to open a PR with a nudge in the right direction.
- Lingua principale
- Rust
- Stelle
- 4.3k
- Fork
- 391
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
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 rust-ndarray/ndarray
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
rust-ndarray/ndarray#1612 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
rust-ndarray/ndarray#1617 · 1 commento ·
-
Stack overflow in `triu` Apertabug good first issue
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
rust-ndarray/ndarray#1615 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
rust-ndarray/ndarray#1610 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
rust-ndarray/ndarray#1609 ·
Tutte le issue di rust-ndarray/ndarray
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
bug rules
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
app bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
IronCoreLabs/ironcore-alloy#346 ·
-
good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100