Skip to content

Commit 174a9fa

Browse files
Rollup merge of #80286 - pierwill:rustc-middle-privacy, r=petrochenkov
docs: Edit rustc_middle::middle::privacy Add descriptions of `AccessLevel` and `AccessLevels`. Add missing punctuation.
2 parents 4addcbc + 80aa551 commit 174a9fa

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

compiler/rustc_middle/src/middle/privacy.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ use rustc_macros::HashStable;
88
use std::fmt;
99
use std::hash::Hash;
1010

11-
// Accessibility levels, sorted in ascending order
11+
/// Represents the levels of accessibility an item can have.
12+
///
13+
/// The variants are sorted in ascending order of accessibility.
1214
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, HashStable)]
1315
pub enum AccessLevel {
1416
/// Superset of `AccessLevel::Reachable` used to mark impl Trait items.
@@ -18,13 +20,13 @@ pub enum AccessLevel {
1820
/// public, then type `T` is reachable. Its values can be obtained by other crates
1921
/// even if the type itself is not nameable.
2022
Reachable,
21-
/// Public items + items accessible to other crates with help of `pub use` re-exports
23+
/// Public items + items accessible to other crates with the help of `pub use` re-exports.
2224
Exported,
23-
/// Items accessible to other crates directly, without help of re-exports
25+
/// Items accessible to other crates directly, without the help of re-exports.
2426
Public,
2527
}
2628

27-
// Accessibility levels for reachable HIR nodes
29+
/// Holds a map of accessibility levels for reachable HIR nodes.
2830
#[derive(Clone)]
2931
pub struct AccessLevels<Id = HirId> {
3032
pub map: FxHashMap<Id, AccessLevel>,

0 commit comments

Comments
 (0)