Skip to content

Commit 11a6d60

Browse files
committed
ConstItemRhs
1 parent 0b1c8b5 commit 11a6d60

File tree

1 file changed

+4
-2
lines changed
  • crates/flux-driver/src/collector

1 file changed

+4
-2
lines changed

crates/flux-driver/src/collector/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl<'a, 'tcx> SpecCollector<'a, 'tcx> {
139139
ItemKind::TyAlias(..) => self.collect_type_alias(owner_id, attrs)?,
140140
ItemKind::Impl(..) => self.collect_impl(owner_id, attrs)?,
141141
ItemKind::Trait(..) => self.collect_trait(owner_id, attrs)?,
142-
ItemKind::Const(.., body_id) => {
142+
ItemKind::Const(.., rhs) => {
143143
// The flux-rs macro puts defs as an outer attribute on a `const _: () = { }`. We
144144
// consider these defs to be defined in the parent of the const.
145145
self.specs
@@ -148,7 +148,9 @@ impl<'a, 'tcx> SpecCollector<'a, 'tcx> {
148148
.or_default()
149149
.extend(attrs.items());
150150

151-
if attrs.extern_spec() {
151+
if attrs.extern_spec()
152+
&& let hir::ConstItemRhs::Body(body_id) = rhs
153+
{
152154
return ExternSpecCollector::collect(self, *body_id);
153155
}
154156

0 commit comments

Comments
 (0)