Skip to content

Commit 9e25221

Browse files
committed
Prefer using the was_remapped helper function
1 parent 3b1641e commit 9e25221

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/rustc_span/src/lib.rs

Lines changed: 2 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_remapped() {
317317
self.local.hash(state);
318318
}
319319
self.maybe_remapped.hash(state);
@@ -390,6 +390,7 @@ 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
}

0 commit comments

Comments
 (0)