|
4 | 4 | //!
|
5 | 5 | //! - the *span*, represented by [`SpanData`] and related types;
|
6 | 6 | //! - source code as represented by a [`SourceMap`]; and
|
7 |
| -//! - interned strings, represented by [`Symbol`]s, with some common symbols available statically in the [`sym`] module. |
| 7 | +//! - interned strings, represented by [`Symbol`]s, with some common symbols available statically |
| 8 | +//! in the [`sym`] module. |
8 | 9 | //!
|
9 |
| -//! Unlike most compilers, the span contains not only the position in the source code, but also various other metadata, |
10 |
| -//! such as the edition and macro hygiene. This metadata is stored in [`SyntaxContext`] and [`ExpnData`]. |
| 10 | +//! Unlike most compilers, the span contains not only the position in the source code, but also |
| 11 | +//! various other metadata, such as the edition and macro hygiene. This metadata is stored in |
| 12 | +//! [`SyntaxContext`] and [`ExpnData`]. |
11 | 13 | //!
|
12 | 14 | //! ## Note
|
13 | 15 | //!
|
@@ -179,8 +181,7 @@ scoped_tls::scoped_thread_local!(static SESSION_GLOBALS: SessionGlobals);
|
179 | 181 |
|
180 | 182 | // FIXME: We should use this enum or something like it to get rid of the
|
181 | 183 | // use of magic `/rust/1.x/...` paths across the board.
|
182 |
| -#[derive(Debug, Eq, PartialEq, Clone, Ord, PartialOrd)] |
183 |
| -#[derive(Decodable)] |
| 184 | +#[derive(Debug, Eq, PartialEq, Clone, Ord, PartialOrd, Decodable)] |
184 | 185 | pub enum RealFileName {
|
185 | 186 | LocalPath(PathBuf),
|
186 | 187 | /// For remapped paths (namely paths into libstd that have been mapped
|
@@ -217,8 +218,8 @@ impl<S: Encoder> Encodable<S> for RealFileName {
|
217 | 218 |
|
218 | 219 | RealFileName::Remapped { ref local_path, ref virtual_name } => encoder
|
219 | 220 | .emit_enum_variant(1, |encoder| {
|
220 |
| - // For privacy and build reproducibility, we must not embed host-dependant path in artifacts |
221 |
| - // if they have been remapped by --remap-path-prefix |
| 221 | + // For privacy and build reproducibility, we must not embed host-dependant path |
| 222 | + // in artifacts if they have been remapped by --remap-path-prefix |
222 | 223 | assert!(local_path.is_none());
|
223 | 224 | local_path.encode(encoder);
|
224 | 225 | virtual_name.encode(encoder);
|
@@ -1529,7 +1530,8 @@ impl SourceFile {
|
1529 | 1530 | })
|
1530 | 1531 | }
|
1531 | 1532 |
|
1532 |
| - /// This converts the `lines` field to contain `SourceFileLines::Lines` if needed and freezes it. |
| 1533 | + /// This converts the `lines` field to contain `SourceFileLines::Lines` if needed and freezes |
| 1534 | + /// it. |
1533 | 1535 | fn convert_diffs_to_lines_frozen(&self) {
|
1534 | 1536 | let mut guard = if let Some(guard) = self.lines.try_write() { guard } else { return };
|
1535 | 1537 |
|
@@ -2267,7 +2269,8 @@ impl<E: rustc_serialize::Encoder> Encodable<E> for ErrorGuaranteed {
|
2267 | 2269 | #[inline]
|
2268 | 2270 | fn encode(&self, _e: &mut E) {
|
2269 | 2271 | panic!(
|
2270 |
| - "should never serialize an `ErrorGuaranteed`, as we do not write metadata or incremental caches in case errors occurred" |
| 2272 | + "should never serialize an `ErrorGuaranteed`, as we do not write metadata or \ |
| 2273 | + incremental caches in case errors occurred" |
2271 | 2274 | )
|
2272 | 2275 | }
|
2273 | 2276 | }
|
|
0 commit comments