Skip to content

Commit 2a94a2d

Browse files
committed
Prefer not accessing the private field of newtype_index types
1 parent b555472 commit 2a94a2d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/rustc_span/src/def_id.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl CrateNum {
3434

3535
impl fmt::Display for CrateNum {
3636
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
37-
fmt::Display::fmt(&self.private, f)
37+
fmt::Display::fmt(&self.as_u32(), f)
3838
}
3939
}
4040

compiler/rustc_span/src/hygiene.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub struct ExpnId {
7676
impl fmt::Debug for ExpnId {
7777
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7878
// Generate crate_::{{expn_}}.
79-
write!(f, "{:?}::{{{{expn{}}}}}", self.krate, self.local_id.private)
79+
write!(f, "{:?}::{{{{expn{}}}}}", self.krate, self.local_id.as_u32())
8080
}
8181
}
8282

0 commit comments

Comments
 (0)