From 84773b3972d6330ee0838916b4a3f83cbc4cfd51 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 1 Nov 2023 16:54:26 +1100 Subject: Formatting tweaks. --- compiler/rustc_span/src/lib.rs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'compiler/rustc_span/src') diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs index d9de2906c3b..00323e93639 100644 --- a/compiler/rustc_span/src/lib.rs +++ b/compiler/rustc_span/src/lib.rs @@ -4,10 +4,12 @@ //! //! - the *span*, represented by [`SpanData`] and related types; //! - source code as represented by a [`SourceMap`]; and -//! - interned strings, represented by [`Symbol`]s, with some common symbols available statically in the [`sym`] module. +//! - interned strings, represented by [`Symbol`]s, with some common symbols available statically +//! in the [`sym`] module. //! -//! Unlike most compilers, the span contains not only the position in the source code, but also various other metadata, -//! such as the edition and macro hygiene. This metadata is stored in [`SyntaxContext`] and [`ExpnData`]. +//! Unlike most compilers, the span contains not only the position in the source code, but also +//! various other metadata, such as the edition and macro hygiene. This metadata is stored in +//! [`SyntaxContext`] and [`ExpnData`]. //! //! ## Note //! @@ -179,8 +181,7 @@ scoped_tls::scoped_thread_local!(static SESSION_GLOBALS: SessionGlobals); // FIXME: We should use this enum or something like it to get rid of the // use of magic `/rust/1.x/...` paths across the board. -#[derive(Debug, Eq, PartialEq, Clone, Ord, PartialOrd)] -#[derive(Decodable)] +#[derive(Debug, Eq, PartialEq, Clone, Ord, PartialOrd, Decodable)] pub enum RealFileName { LocalPath(PathBuf), /// For remapped paths (namely paths into libstd that have been mapped @@ -217,8 +218,8 @@ impl Encodable for RealFileName { RealFileName::Remapped { ref local_path, ref virtual_name } => encoder .emit_enum_variant(1, |encoder| { - // For privacy and build reproducibility, we must not embed host-dependant path in artifacts - // if they have been remapped by --remap-path-prefix + // For privacy and build reproducibility, we must not embed host-dependant path + // in artifacts if they have been remapped by --remap-path-prefix assert!(local_path.is_none()); local_path.encode(encoder); virtual_name.encode(encoder); @@ -1529,7 +1530,8 @@ impl SourceFile { }) } - /// This converts the `lines` field to contain `SourceFileLines::Lines` if needed and freezes it. + /// This converts the `lines` field to contain `SourceFileLines::Lines` if needed and freezes + /// it. fn convert_diffs_to_lines_frozen(&self) { let mut guard = if let Some(guard) = self.lines.try_write() { guard } else { return }; @@ -2267,7 +2269,8 @@ impl Encodable for ErrorGuaranteed { #[inline] fn encode(&self, _e: &mut E) { panic!( - "should never serialize an `ErrorGuaranteed`, as we do not write metadata or incremental caches in case errors occurred" + "should never serialize an `ErrorGuaranteed`, as we do not write metadata or \ + incremental caches in case errors occurred" ) } } -- cgit 1.4.1-3-g733a5