rust-lang / rust-lang/reference
Document the type privacy restrictions
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.6k
- Forks
- 607
- PR merge metrics
- PR metrics pending
Description
The following program is rejected (though the sub module alone would be accepted with a warning):
mod sub {
struct Priv;
pub fn get_value() -> Priv { todo!() }
}
fn main() {
sub::get_value();
}
I believe the restrictions which cause this rejection aren't described at present in the Reference.
I think the best available documentation is in rfc2145.
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.
Research direction
Start by reading the Rust Reference sections covering visibility and the linked RFC 2145, then compare them with the rejected example and the warning behavior for the sub module. Done means the Reference explains the type privacy restrictions that make the complete program invalid and distinguishes them from the warning case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100