1
Fork 0

Error on define_opaques entries without any opaques actually referenced

This commit is contained in:
Oli Scherer 2025-02-25 10:31:11 +00:00
parent 43e39260f9
commit 69a1bb8bdb
6 changed files with 17 additions and 7 deletions

View file

@ -1696,7 +1696,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
);
return None;
};
Some(did)
Some((self.lower_span(path.span), did))
});
let define_opaque = self.arena.alloc_from_iter(define_opaque);
self.define_opaque = Some(define_opaque);

View file

@ -99,7 +99,7 @@ struct LoweringContext<'a, 'hir> {
/// Bodies inside the owner being lowered.
bodies: Vec<(hir::ItemLocalId, &'hir hir::Body<'hir>)>,
/// `#[define_opaque]` attributes
define_opaque: Option<&'hir [LocalDefId]>,
define_opaque: Option<&'hir [(Span, LocalDefId)]>,
/// Attributes inside the owner being lowered.
attrs: SortedMap<hir::ItemLocalId, &'hir [hir::Attribute]>,
/// Collect items that were created by lowering the current owner.