Skip to content
This repository was archived by the owner on Jul 29, 2026. It is now read-only.
This repository was archived by the owner on Jul 29, 2026. It is now read-only.

Error reporting in programs without constraints #233

Description

@bufferhe4d

I was writing the following example (an example where there are no constraints with a public input):

fn main(pub aa: Field) {
    let mut xx = aa + 1;
}

After running cargo run test --path examples/no_cons.no --public-inputs '{"aa": "3"}', I hit the following error:

Error:   × Looks like something went wrong in constraint-finalization
   ╭─[<BUILTIN>:1:1]
 1 │ <SEE NONAME CODE>
   · ▲
   · ╰── here
   ╰────
  help: Unexpected error: there's a bug in the circuit_writer, some cellvar does not end up being a cellvar in the circuit!.

If I try the same example with a private input, the error is more descriptive:

Error:   × Looks like something went wrong in constraint-finalization
   ╭─[examples/no_cons.no:1:1]
 1 │ fn main(aa: Field) {
   ·         ─┬
   ·          ╰── here
 2 │     let mut xx = aa + 1;
   ╰────
  help: private input not used in the circuit

I thought it could help to give the same error in those cases as help: public input not used in the circuit

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions