Skip to content

Commit 07c729e

Browse files
committed
Prefer using the was_remapped helper function
1 parent ac5cf76 commit 07c729e

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);
@@ -382,6 +382,7 @@ impl RealFileName {
382382
}
383383

384384
/// Returns whenever the filename was remapped.
385+
#[inline]
385386
pub(crate) fn was_remapped(&self) -> bool {
386387
!self.scopes.is_empty()
387388
}

0 commit comments

Comments
 (0)