Skip to content

Commit 84773b3

Browse files
committed
Formatting tweaks.
1 parent 222c223 commit 84773b3

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

compiler/rustc_span/src/lib.rs

+12-9
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
//!
55
//! - the *span*, represented by [`SpanData`] and related types;
66
//! - 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.
89
//!
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`].
1113
//!
1214
//! ## Note
1315
//!
@@ -179,8 +181,7 @@ scoped_tls::scoped_thread_local!(static SESSION_GLOBALS: SessionGlobals);
179181

180182
// FIXME: We should use this enum or something like it to get rid of the
181183
// 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)]
184185
pub enum RealFileName {
185186
LocalPath(PathBuf),
186187
/// For remapped paths (namely paths into libstd that have been mapped
@@ -217,8 +218,8 @@ impl<S: Encoder> Encodable<S> for RealFileName {
217218

218219
RealFileName::Remapped { ref local_path, ref virtual_name } => encoder
219220
.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
222223
assert!(local_path.is_none());
223224
local_path.encode(encoder);
224225
virtual_name.encode(encoder);
@@ -1529,7 +1530,8 @@ impl SourceFile {
15291530
})
15301531
}
15311532

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.
15331535
fn convert_diffs_to_lines_frozen(&self) {
15341536
let mut guard = if let Some(guard) = self.lines.try_write() { guard } else { return };
15351537

@@ -2267,7 +2269,8 @@ impl<E: rustc_serialize::Encoder> Encodable<E> for ErrorGuaranteed {
22672269
#[inline]
22682270
fn encode(&self, _e: &mut E) {
22692271
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"
22712274
)
22722275
}
22732276
}

0 commit comments

Comments
 (0)