Skip to content

Commit 12a886f

Browse files
committed
rustdoc: Make a bunch of fields private
1 parent 894fdf9 commit 12a886f

File tree

1 file changed

+13
-11
lines changed
  • src/librustdoc/html/render

1 file changed

+13
-11
lines changed

src/librustdoc/html/render/mod.rs

+13-11
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,16 @@ crate fn ensure_trailing_slash(v: &str) -> impl fmt::Display + '_ {
102102
crate struct Context<'tcx> {
103103
/// Current hierarchy of components leading down to what's currently being
104104
/// rendered
105-
crate current: Vec<String>,
105+
current: Vec<String>,
106106
/// The current destination folder of where HTML artifacts should be placed.
107107
/// This changes as the context descends into the module hierarchy.
108-
crate dst: PathBuf,
108+
dst: PathBuf,
109109
/// A flag, which when `true`, will render pages which redirect to the
110110
/// real location of an item. This is used to allow external links to
111111
/// publicly reused items to redirect to the right location.
112-
crate render_redirect_pages: bool,
113-
crate shared: Rc<SharedContext<'tcx>>,
112+
render_redirect_pages: bool,
113+
/// Shared mutable state. We should probably redesign this.
114+
shared: Rc<SharedContext<'tcx>>,
114115
/// The [`Cache`] used during rendering.
115116
///
116117
/// Ideally the cache would be in [`SharedContext`], but it's mutated
@@ -120,9 +121,10 @@ crate struct Context<'tcx> {
120121
/// It's immutable once in `Context`, so it's not as bad that it's not in
121122
/// `SharedContext`.
122123
// FIXME: move `cache` to `SharedContext`
123-
crate cache: Rc<Cache>,
124+
cache: Rc<Cache>,
124125
}
125126

127+
/// Shared mutable state in [`Context`]. We should probably redesign this.
126128
crate struct SharedContext<'tcx> {
127129
crate tcx: TyCtxt<'tcx>,
128130
/// The path to the crate root source minus the file name.
@@ -138,16 +140,16 @@ crate struct SharedContext<'tcx> {
138140
/// The local file sources we've emitted and their respective url-paths.
139141
crate local_sources: FxHashMap<PathBuf, String>,
140142
/// Whether the collapsed pass ran
141-
crate collapsed: bool,
143+
collapsed: bool,
142144
/// The base-URL of the issue tracker for when an item has been tagged with
143145
/// an issue number.
144-
crate issue_tracker_base_url: Option<String>,
146+
issue_tracker_base_url: Option<String>,
145147
/// The directories that have already been created in this doc run. Used to reduce the number
146148
/// of spurious `create_dir_all` calls.
147-
crate created_dirs: RefCell<FxHashSet<PathBuf>>,
149+
created_dirs: RefCell<FxHashSet<PathBuf>>,
148150
/// This flag indicates whether listings of modules (in the side bar and documentation itself)
149151
/// should be ordered alphabetically or in order of appearance (in the source code).
150-
crate sort_modules_alphabetically: bool,
152+
sort_modules_alphabetically: bool,
151153
/// Additional CSS files to be added to the generated docs.
152154
crate style_files: Vec<StylePath>,
153155
/// Suffix to be added on resource files (if suffix is "-v2" then "light.css" becomes
@@ -160,7 +162,7 @@ crate struct SharedContext<'tcx> {
160162
crate fs: DocFS,
161163
/// The default edition used to parse doctests.
162164
crate edition: Edition,
163-
crate codes: ErrorCodes,
165+
codes: ErrorCodes,
164166
playground: Option<markdown::Playground>,
165167
/// The map used to ensure all generated 'id=' attributes are unique.
166168
id_map: RefCell<IdMap>,
@@ -170,7 +172,7 @@ crate struct SharedContext<'tcx> {
170172
all: RefCell<AllTypes>,
171173
/// Storage for the errors produced while generating documentation so they
172174
/// can be printed together at the end.
173-
crate errors: Receiver<String>,
175+
errors: Receiver<String>,
174176
}
175177

176178
impl<'tcx> Context<'tcx> {

0 commit comments

Comments
 (0)