Implement #[define_opaque] attribute for functions.

This commit is contained in:
Oli Scherer 2024-07-26 10:04:02 +00:00 committed by Oli Scherer
parent 2c6a12ec44
commit cb4751d4b8
653 changed files with 2911 additions and 2580 deletions

View file

@ -1307,13 +1307,18 @@ impl Attribute {
#[derive(Debug)]
pub struct AttributeMap<'tcx> {
pub map: SortedMap<ItemLocalId, &'tcx [Attribute]>,
/// Preprocessed `#[define_opaque]` attribute.
pub define_opaque: Option<&'tcx [LocalDefId]>,
// Only present when the crate hash is needed.
pub opt_hash: Option<Fingerprint>,
}
impl<'tcx> AttributeMap<'tcx> {
pub const EMPTY: &'static AttributeMap<'static> =
&AttributeMap { map: SortedMap::new(), opt_hash: Some(Fingerprint::ZERO) };
pub const EMPTY: &'static AttributeMap<'static> = &AttributeMap {
map: SortedMap::new(),
opt_hash: Some(Fingerprint::ZERO),
define_opaque: None,
};
#[inline]
pub fn get(&self, id: ItemLocalId) -> &'tcx [Attribute] {