about summary refs log tree commit diff
diff options
context:
space:
mode:
authorpierwill <pierwill@users.noreply.github.com>2020-12-21 20:00:18 -0800
committerpierwill <pierwill@users.noreply.github.com>2020-12-21 20:05:05 -0800
commit80aa551d668233280e78b689b56ccb6cbffca368 (patch)
treee2c610e6dc05bb96fea5e5226298433cb45f0ac0
parent11c94a197726b6a981828cb1837d7c3eed1b841d (diff)
downloadrust-80aa551d668233280e78b689b56ccb6cbffca368.tar.gz
rust-80aa551d668233280e78b689b56ccb6cbffca368.zip
docs: Edit rustc_middle::middle::privacy
Add descriptions of `AccessLevel` and `AccessLevels`.

Add missing punctuation.
-rw-r--r--compiler/rustc_middle/src/middle/privacy.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/compiler/rustc_middle/src/middle/privacy.rs b/compiler/rustc_middle/src/middle/privacy.rs
index 254b57a005e..54188985d7c 100644
--- a/compiler/rustc_middle/src/middle/privacy.rs
+++ b/compiler/rustc_middle/src/middle/privacy.rs
@@ -8,7 +8,9 @@ use rustc_macros::HashStable;
 use std::fmt;
 use std::hash::Hash;
 
-// Accessibility levels, sorted in ascending order
+/// Represents the levels of accessibility an item can have.
+///
+/// The variants are sorted in ascending order of accessibility.
 #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, HashStable)]
 pub enum AccessLevel {
     /// Superset of `AccessLevel::Reachable` used to mark impl Trait items.
@@ -18,13 +20,13 @@ pub enum AccessLevel {
     /// public, then type `T` is reachable. Its values can be obtained by other crates
     /// even if the type itself is not nameable.
     Reachable,
-    /// Public items + items accessible to other crates with help of `pub use` re-exports
+    /// Public items + items accessible to other crates with the help of `pub use` re-exports.
     Exported,
-    /// Items accessible to other crates directly, without help of re-exports
+    /// Items accessible to other crates directly, without the help of re-exports.
     Public,
 }
 
-// Accessibility levels for reachable HIR nodes
+/// Holds a map of accessibility levels for reachable HIR nodes.
 #[derive(Clone)]
 pub struct AccessLevels<Id = HirId> {
     pub map: FxHashMap<Id, AccessLevel>,