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: cannot export private function via public static variable #6464

Closed
gifnksm opened this issue May 14, 2013 · 3 comments
Closed

ICE: cannot export private function via public static variable #6464

gifnksm opened this issue May 14, 2013 · 3 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@gifnksm
Copy link
Contributor

gifnksm commented May 14, 2013

Following code causing ICE.
foo.rs

pub static fun: extern fn() = foo;

fn foo() {
  println("Foo");
}

main.rs

extern mod foo;

fn main() {
  (foo::fun)();
}
$  rustc --lib foo.rs
warning: missing crate link meta `name`, using `foo` as default
warning: missing crate link meta `vers`, using `0.0` as default
$ rustc main.rs -L .
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues

If foo::foo is declared as pub, the code compiles successfully.

@gifnksm
Copy link
Contributor Author

gifnksm commented May 14, 2013

This may be related to #4202.

@thomaslee
Copy link
Contributor

It feels relatively unlikely to me that this relates directly to #4202, but I'll try to take a look at this later in the week -- unless of course you're keen to fix it yourself @gifnksm :)

@bblum
Copy link
Contributor

bblum commented Jul 26, 2013

The error message of the ICE is "'lookup_item: id not found: 11', /home/rustbuild/src/rust-buildbot/slave/snap3-linux/build/src/librustc/metadata/decoder.rs:86".

But, this appears to work fine with my stage1 compiler, despite reproducing on stage0. Reopen if this comes back, I guess?

@bblum bblum closed this as completed Jul 26, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Dec 20, 2020
…_exhaustive-structs, r=phansch

make needless_update ignore non_exhaustive structs

changelog: make `needless_update` lint ignore `non_exhaustive` structs

fixes rust-lang#6323
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

No branches or pull requests

3 participants