@@ -102,15 +102,16 @@ crate fn ensure_trailing_slash(v: &str) -> impl fmt::Display + '_ {
102
102
crate struct Context < ' tcx > {
103
103
/// Current hierarchy of components leading down to what's currently being
104
104
/// rendered
105
- crate current : Vec < String > ,
105
+ current : Vec < String > ,
106
106
/// The current destination folder of where HTML artifacts should be placed.
107
107
/// This changes as the context descends into the module hierarchy.
108
- crate dst : PathBuf ,
108
+ dst : PathBuf ,
109
109
/// A flag, which when `true`, will render pages which redirect to the
110
110
/// real location of an item. This is used to allow external links to
111
111
/// 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 > > ,
114
115
/// The [`Cache`] used during rendering.
115
116
///
116
117
/// Ideally the cache would be in [`SharedContext`], but it's mutated
@@ -120,9 +121,10 @@ crate struct Context<'tcx> {
120
121
/// It's immutable once in `Context`, so it's not as bad that it's not in
121
122
/// `SharedContext`.
122
123
// FIXME: move `cache` to `SharedContext`
123
- crate cache : Rc < Cache > ,
124
+ cache : Rc < Cache > ,
124
125
}
125
126
127
+ /// Shared mutable state in [`Context`]. We should probably redesign this.
126
128
crate struct SharedContext < ' tcx > {
127
129
crate tcx : TyCtxt < ' tcx > ,
128
130
/// The path to the crate root source minus the file name.
@@ -138,16 +140,16 @@ crate struct SharedContext<'tcx> {
138
140
/// The local file sources we've emitted and their respective url-paths.
139
141
crate local_sources : FxHashMap < PathBuf , String > ,
140
142
/// Whether the collapsed pass ran
141
- crate collapsed : bool ,
143
+ collapsed : bool ,
142
144
/// The base-URL of the issue tracker for when an item has been tagged with
143
145
/// an issue number.
144
- crate issue_tracker_base_url : Option < String > ,
146
+ issue_tracker_base_url : Option < String > ,
145
147
/// The directories that have already been created in this doc run. Used to reduce the number
146
148
/// of spurious `create_dir_all` calls.
147
- crate created_dirs : RefCell < FxHashSet < PathBuf > > ,
149
+ created_dirs : RefCell < FxHashSet < PathBuf > > ,
148
150
/// This flag indicates whether listings of modules (in the side bar and documentation itself)
149
151
/// should be ordered alphabetically or in order of appearance (in the source code).
150
- crate sort_modules_alphabetically : bool ,
152
+ sort_modules_alphabetically : bool ,
151
153
/// Additional CSS files to be added to the generated docs.
152
154
crate style_files : Vec < StylePath > ,
153
155
/// Suffix to be added on resource files (if suffix is "-v2" then "light.css" becomes
@@ -160,7 +162,7 @@ crate struct SharedContext<'tcx> {
160
162
crate fs : DocFS ,
161
163
/// The default edition used to parse doctests.
162
164
crate edition : Edition ,
163
- crate codes : ErrorCodes ,
165
+ codes : ErrorCodes ,
164
166
playground : Option < markdown:: Playground > ,
165
167
/// The map used to ensure all generated 'id=' attributes are unique.
166
168
id_map : RefCell < IdMap > ,
@@ -170,7 +172,7 @@ crate struct SharedContext<'tcx> {
170
172
all : RefCell < AllTypes > ,
171
173
/// Storage for the errors produced while generating documentation so they
172
174
/// can be printed together at the end.
173
- crate errors : Receiver < String > ,
175
+ errors : Receiver < String > ,
174
176
}
175
177
176
178
impl < ' tcx > Context < ' tcx > {
0 commit comments