Skip to content

Commit

Permalink
Rollup merge of #93692 - mfrw:mfrw/document-keyword-in, r=dtolnay
Browse files Browse the repository at this point in the history
keyword_docs: document use of `in` with `pub` keyword

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>

Fixes: #93609
  • Loading branch information
Dylan-DPC authored Mar 19, 2022
2 parents fe55eee + 6706ab8 commit 463e516
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions library/std/src/keyword_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,20 @@ mod impl_keyword {}
/// [`IntoIterator`]: ../book/ch13-04-performance.html
/// [range patterns]: ../reference/patterns.html?highlight=range#range-patterns
/// [`for`]: keyword.for.html
///
/// The other use of `in` is with the keyword `pub`. It allows users to declare an item as visible
/// only within a given scope.
///
/// ## Literal Example:
///
/// * `pub(in crate::outer_mod) fn outer_mod_visible_fn() {}` - fn is visible in `outer_mod`
///
/// Starting with the 2018 edition, paths for `pub(in path)` must start with `crate`, `self` or
/// `super`. The 2015 edition may also use paths starting with `::` or modules from the crate root.
///
/// For more information, see the [Reference].
///
/// [Reference]: ../reference/visibility-and-privacy.html#pubin-path-pubcrate-pubsuper-and-pubself
mod in_keyword {}

#[doc(keyword = "let")]
Expand Down

0 comments on commit 463e516

Please sign in to comment.