Skip to content

Commit a6893f1

Browse files
committed
Use a helper function to be more explicit regarding fully remapped paths
1 parent 3b1641e commit a6893f1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

compiler/rustc_span/src/lib.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ impl Hash for RealFileName {
313313
// remapped path if that exists. This is because remapped paths to
314314
// sysroot crates (/rust/$hash or /rust/$version) remain stable even
315315
// if the corresponding local path changes.
316-
if !self.scopes.is_all() {
316+
if !self.was_fully_remapped() {
317317
self.local.hash(state);
318318
}
319319
self.maybe_remapped.hash(state);
@@ -390,10 +390,17 @@ impl RealFileName {
390390
}
391391

392392
/// Returns whenever the filename was remapped.
393+
#[inline]
393394
pub(crate) fn was_remapped(&self) -> bool {
394395
!self.scopes.is_empty()
395396
}
396397

398+
/// Returns whenever the filename was fully remapped.
399+
#[inline]
400+
fn was_fully_remapped(&self) -> bool {
401+
self.scopes.is_all()
402+
}
403+
397404
/// Returns an empty `RealFileName`
398405
///
399406
/// Useful as the working directory input to `SourceMap::to_real_filename`.

0 commit comments

Comments
 (0)