Open msprotz opened 5 months ago
That really seems like a bug. See also #194 for our plans for closures
Ok I worked around it by normalizing (t) to t everywhere.
This is strange. I wonder where the tuple is introduced: is it Rustc's fault or our fault?
I think this is the culprit (we should check if the length is 1): https://github.com/AeneasVerif/charon/blob/793680f108a4e1a56c9550b62aee751543aa242a/charon/src/transform/update_closure_signatures.rs#L82
(and if not the problem is probably in this file)
I would guess the tuple comes from the Fn
trait: a closure like |x, y, z| ...
implements Fn<(X, Y, Z)>
. Do we special-case the case of single arguments anywhere?
I do some transformations above to, among other things, make the closure state more explicit (this is the update_closure_signatures
file I refer to above). The error likely comes from there, and especially this line where I do not special case on single arguments (I didn't have much time to recheck the code, but it is possible Rust does it on its side).
if I run eurydice on this, and I pass
--log '*'
, I get a dump of the LLBC:Now here's the snippet of Eurydice that we care for:
Here's the fun bit: the types in the signature don't agree with the types of the locals.
notably, one has a tuple of size one for the usize, while the other doesn't!
Please help me understand if I'm missing something or if this is a bug somewhere. Thanks!