Skip to content

Conversation

@Stevengre
Copy link
Contributor

@Stevengre Stevengre commented Nov 4, 2025

Problem

While exporting SMIR, stable-mir-json fails to record types for closure/function constants. Consumers that rely on lookupTy (e.g., KMIR) therefore fall back to typeInfoVoidType, which eventually produces thunk values and halts execution. This surfaced when running kmir prove-rs/kmir show on interior-mut-refcell.rs.

Changes

  • Ensure TyCollector::visit_ty always inserts Closure, FnDef, and FnPtr types into self.types, even if visiting the instance short-circuits.
  • In InternedValueCollector::visit_mir_const, always feed the constant’s own ty into the TyCollector, so zero-sized constants also get their metadata recorded.

Result

The generated *.smir.json now contains the missing function-item types. KMIR no longer falls back to typeInfoVoidType, and the previously stuck proof run completes without emitting thunk.

@Stevengre Stevengre self-assigned this Nov 4, 2025
@Stevengre Stevengre changed the title feat: Ensure SMIR export records function item types feat: ensure SMIR export records function item types Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants