-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICE: unreacheable code #5008
Comments
Mutable references should be banned from crossing the constrained -> unconstrained boundary. CC @sirasistant. I suspect this somehow getting past that check is what is going wrong here. |
See related issue: #4245 |
Looks like the issue is that we only check if the type being passed is a mutable reference rather than it containing any mutable references. |
… it from constrained code to unconstrained code (#5009) # Description ## Problem\* Resolves #5008 ## Summary\* Thank you to @nventuro for the minimal example and @TomAFrench for looking into this. As a result it was a quick fix. ## Additional Context All type system fixes must currently be duplicated in the elaborator so I've included this there as well. ## 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. --------- Co-authored-by: TomAFrench <tom@tomfren.ch> Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
Aim
This is a follow up to #4497. I did some more trimming and arrived at a minimal example that results in a compiler crash.
Bug
The following program crashes:
The error message is
I couldn't distill this down any further. The crash is avoided with any of these changes:
main
isunconstrained
crash_fn
is notunconstrained
bar
takes a&
and not a&mut
Bar
has no memberscrash_fn
doesn't takeself
So it seems like the bug is related to some odd combination of all of the above.
To Reproduce
Compile the program above.
Project Impact
Blocker
Impact Context
This blocks some currently open PRs, such as AztecProtocol/aztec-packages#4940.
Workaround
None
Workaround Description
No response
Additional Context
No response
Installation Method
Compiled from source
Nargo Version
nargo version = 0.28.0 noirc version = 0.28.0+98eb519766ae219d2f10550944bba83f30f7662c (git version hash: 98eb519766ae219d2f10550944bba83f30f7662c, is dirty: false)
The text was updated successfully, but these errors were encountered: