Skip to content

Conversation

anim001k
Copy link

Problem

The fmt::Display implementation for ConstraintTrace used metadata.module_path().unwrap(), which could panic if the module path is not available for certain spans (e.g., from macros or external sources).

Solution

Replace unwrap() with unwrap_or(metadata.target()) to provide a safe fallback using the span's target as an alternative identifier.

Changes

  • File: relations/src/gr1cs/trace.rs
  • Line: 310
  • Before: metadata.module_path().unwrap()
  • After: metadata.module_path().unwrap_or(metadata.target())

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.

1 participant