stackable-versioned: Require inner module definitions to have the same visibility as the parent
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Inizia individuando l’implementazione stackable-versioned che elabora le definizioni dei moduli esterno e interno. Aggiungi una validazione in modo che una visibilità non corrispondente produca un avviso o un errore, quindi verifica il comportamento con gli esempi di moduli annidati descritti nell’issue.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
As discussion with @Techassi, we should warn/error if the visibility of the inner module doesn't match the outer module.
The inner module ends up with the same visibility as the parent anyway, but it is confusing if it is not the same.
#[versioned(version(name = "v1alpha1"))]
pub mod versioned {
// contents of this mod get merged with the generated `v1alpha` mod.
// nothing unusual here, pub all the way
pub mod v1alpha1 {
pub use v1alpha1_impl::Error;
}
}
Is equivalent to:
#[versioned(version(name = "v1alpha1"))]
pub mod versioned {
// contents of this mod get merged with the generated `v1alpha` mod,
// with `pub` visibility (because of `pub mod versioned`).
// 👇
mod v1alpha1 {
pub use v1alpha1_impl::Error;
}
}
However, it appears confusing to the reader. Eg:
How can the pub use be of any use inside a private mod?
... with the answer being oh, the mod is actually pub mod because of pub mod versioned which leads to pub mod v1alpha being generated, which absorbs the contents of the mod v1alpha1 that you see in the source.
- Lingua principale
- Rust
- Stelle
- 167
- Fork
- 19
- Merge medio
- 1g 6h
- PR unite (30g)
- 9
Guida per i contributori
Apri la guida per i contributori
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 stackabletech/operator-rs
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
stackabletech/operator-rs#1273 · 1 commento ·
-
Improve label mechanisms Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
stackabletech/operator-rs#1077 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
stackabletech/operator-rs#1063 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
stackabletech/operator-rs#965 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
stackabletech/operator-rs#906 ·
Tutte le issue di stackabletech/operator-rs
Issue simili
-
Browser (wasm) relay client cannot connect to relays whose URL has a trailing-dot FQDN hostname Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
n0-computer/iroh#4550 ·
-
impl detach for native Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
paritytech/zombienet-sdk#591 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
farion1231/cc-switch#7638 · 1 commento ·
-
onnx-ir re-exports ModelProto and GraphProto but not NodeProto, AttributeProto and AttributeType Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100