We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This error happens when trying to access self within local/embedded function:
self
struct A; impl A { fn m(&self) { fn x() { self.m() } } }
The text was updated successfully, but these errors were encountered:
When I attempt to replicate the bug, I get the following output from rustc:
% ./x86_64-apple-darwin/stage2/bin/rustc -v ./x86_64-apple-darwin/stage2/bin/rustc 0.8-pre (9c22f65 2013-07-15 05:01:19 -0700) host: x86_64-apple-darwin % ./x86_64-apple-darwin/stage2/bin/rustc /tmp/foo.rs /tmp/foo.rs:4:13: 4:18 error: can't capture dynamic environment in a fn item; use the || { ... } closure form instead /tmp/foo.rs:4 fn x() { self.m() } ^~~~~ /tmp/foo.rs:4:13: 4:18 error: internal compiler error: self wasn't mapped to a def?! /tmp/foo.rs:4 fn x() { self.m() } ^~~~~ %
The ICE is indeed disturbing, but the earlier error indicates that something is awry in the code.
When I changed the code by replacing the fn x() { ... } with let x = || { ... }, the code seems to compile fine...
fn x() { ... }
let x = || { ... }
Sorry, something went wrong.
(not closing since we should still try to stamp out the ICE.)
Just ran into this myself. Confirming.
easy to fix this
0081961
No branches or pull requests
This error happens when trying to access
self
within local/embedded function:The text was updated successfully, but these errors were encountered: