Skip to content

ICE when calling constant function reference #4523

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

Closed
jdm opened this issue Jan 17, 2013 · 1 comment
Closed

ICE when calling constant function reference #4523

jdm opened this issue Jan 17, 2013 · 1 comment
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Milestone

Comments

@jdm
Copy link
Contributor

jdm commented Jan 17, 2013

rusti> fn foopy() {}
()
rusti> const f: fn() = foopy;
()
rusti> f()
<anon>:39:0: 39:1 error: internal compiler error: Cannot translate def def_const({crate: 0, node: 26}) to a callable thing!
<anon>:39 f()
          ^
rust: task failed at 'explicit failure', /run/media/jdm/ssd/rust/src/libsyntax/diagnostic.rs:62
@catamorphism
Copy link
Contributor

As of f1b05ec I get a proper error message:

<anon>:37:16: 37:21 error: mismatched types: expected `&static/fn()` but found `extern fn()` (expected & closure, found extern closure)
<anon>:37 const f: fn() = foopy;
                          ^~~~~

So I guess this has been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants