Nondeterministic behavior when referencing a closure more than once #5783
Labels
A-lifetimes
Area: Lifetimes / regions
A-typesystem
Area: The type system
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
I-crash
Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
This program works as expected:
Uncomment that line and something goofy happens:
The second print will be a different number every time it is run. This feels quite dangerous.
And if you try to use
error!(b(3))
, even in the first program, you get a segfault. But that might be a separate bug.The text was updated successfully, but these errors were encountered: