hacspec
hacspec copied to clipboard
Improve handling of colliding symbols
We recently ran into the issue where we had
sha256.rs
array!(Digest, 16);
lib.rs
use sha256::*;
type Digest ByteSeq;
fn foo() {
let d = Digest::new(5);
}
In this case the Digest
name clashes. This is fine for rustc but the hacspec typechecker fails when calling new
because it thinks it's the array, where new
doesn't require any arguments.
This creates very hard to track down typechecker errors.
hir_to_rustspec.rs
should check names when importing them.