stackable-versioned: Require inner module definitions to have the same visibility as the parent
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start by locating the stackable-versioned implementation that processes the outer and inner module definitions. Add validation so mismatched visibility produces a warning or error, then verify the behavior against the nested module examples described in the issue.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Rust
- Stars
- 167
- Forks
- 19
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 9
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from stackabletech/operator-rs
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
stackabletech/operator-rs#1273 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
stackabletech/operator-rs#1077 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
stackabletech/operator-rs#1063 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
stackabletech/operator-rs#965 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
stackabletech/operator-rs#906 ·
All issues in stackabletech/operator-rs
Similar issues
-
Browser (wasm) relay client cannot connect to relays whose URL has a trailing-dot FQDN hostname Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
n0-computer/iroh#4550 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
paritytech/zombienet-sdk#591 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
farion1231/cc-switch#7638 · 1 comment ·
-
onnx-ir re-exports ModelProto and GraphProto but not NodeProto, AttributeProto and AttributeType Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100