Associated items and variants inherit visibility from their traits and enums respectively.
This commit is contained in:
parent
8323185941
commit
e095c710f7
1 changed files with 1 additions and 1 deletions
|
@ -1732,7 +1732,7 @@ warnings are generated, or otherwise "you used a private item of another module
|
|||
and weren't allowed to."
|
||||
|
||||
By default, everything in Rust is *private*, with two exceptions: Associated
|
||||
items of a Trait are public by default; Enum variants
|
||||
items in a `pub` Trait are public by default; Enum variants
|
||||
in a `pub` enum are also public by default. When an item is declared as `pub`,
|
||||
it can be thought of as being accessible to the outside world. For example:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue