Merge pull request #18074 from ChayimFriedman2/typeref-source-map

internal: Build source map for `hir_def::TypeRef`s
This commit is contained in:
Lukas Wirth 2024-10-28 11:01:12 +00:00 committed by GitHub
commit 80e9d014be
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
46 changed files with 2511 additions and 929 deletions

View file

@ -26,6 +26,7 @@ use crate::{
/// Syntactical attributes, without filtering of `cfg_attr`s.
#[derive(Default, Debug, Clone, PartialEq, Eq)]
pub struct RawAttrs {
// FIXME: This can become `Box<[Attr]>` if https://internals.rust-lang.org/t/layout-of-dst-box/21728?u=chrefr is accepted.
entries: Option<ThinArc<(), Attr>>,
}
@ -169,6 +170,10 @@ impl RawAttrs {
};
RawAttrs { entries }
}
pub fn is_empty(&self) -> bool {
self.entries.is_none()
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]