Skip to content
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] Calling syntax on struct #46771

Closed
leonardo-m opened this issue Dec 16, 2017 · 0 comments · Fixed by #46780
Closed

[ICE] Calling syntax on struct #46771

leonardo-m opened this issue Dec 16, 2017 · 0 comments · Fixed by #46780
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@leonardo-m
Copy link

fn main() {
    struct Foo;
    (1 .. 2).find(|_| Foo(0) == 0);
}

Gives:

error[E0618]: expected function, found `main::Foo`
 --> ...\test.rs:3:24
  |
3 |     (1 .. 2).find(|_| Foo(0) == 0);
  |                        ^^^^^^
  |
note: defined here
 --> ...\test.rs:2:5
  |
2 |     struct Foo;
  |     ^^^^^^^^^^^

error: internal compiler error: unexpected panic

note: rustc 1.24.0-nightly (77efd6800 2017-12-15) running on x86_64-pc-windows-gnu

thread 'rustc' panicked at 'LocalTableInContext: key not found', src\libcore\option.rs:891:4

Eventually we'll have to start fuzzying the Rustc compiler.

@frewsxcv frewsxcv added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Dec 19, 2017
kennytm added a commit to kennytm/rust that referenced this issue Dec 21, 2017
Fix ICE when calling non-functions within closures

The visitor for walking function bodies did not previously properly
handle error-cases for function calls. These are now ignored,
preventing the panic. This fixes rust-lang#46771.
bors added a commit that referenced this issue Jul 1, 2018
Always check type_dependent_defs

Directly indexing into `type_dependent_defs` has caused multiple ICEs in the past (#46771, #49241, etc.) and is almost certainly responsible for #51798 too. This PR ensures we always check `type_dependent_defs` first, which should prevent any more of these (or at least make them easier to track down).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants