Skip to content

Commit

Permalink
chore: Display comptime assertion errors, not Debug (#5605)
Browse files Browse the repository at this point in the history
# Description

## Problem\*

Resolves <!-- Link to GitHub Issue -->

## Summary\*

Changes:
```
error: FormatString("No derive function registered for `quote { Default }`", fmtstr<53, (Quoted)>)
   ┌─ /.../derive/src/main.nr:19:16
   │
19 │         assert(handler.is_some(), f"No derive function registered for `{trait_to_derive}`");
   │                ----------------- Assertion failed
   │
```

To:
```
error: No derive function registered for `quote { Default }`
   ┌─ /.../derive/src/main.nr:19:16
   │
19 │         assert(handler.is_some(), f"No derive function registered for `{trait_to_derive}`");
   │                ----------------- Assertion failed
   │
```

## Additional Context



## Documentation\*

Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
  • Loading branch information
jfecher authored Jul 25, 2024
1 parent d048e82 commit d85bf61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/noirc_frontend/src/hir/comptime/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ impl<'a> From<&'a InterpreterError> for CustomDiagnostic {
}
InterpreterError::FailingConstraint { message, location } => {
let (primary, secondary) = match message {
Some(msg) => (format!("{msg:?}"), "Assertion failed".into()),
Some(msg) => (format!("{msg}"), "Assertion failed".into()),
None => ("Assertion failed".into(), String::new()),
};
CustomDiagnostic::simple_error(primary, secondary, location.span)
Expand Down

0 comments on commit d85bf61

Please sign in to comment.