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: defining static with struct that contains enum with &'static str variant #13214

Closed
arjantop opened this issue Mar 30, 2014 · 2 comments · Fixed by #14788
Closed

ICE: defining static with struct that contains enum with &'static str variant #13214

arjantop opened this issue Mar 30, 2014 · 2 comments · Fixed by #14788
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.

Comments

@arjantop
Copy link
Contributor

If you change char in Test to int the error is gone, also adding another field or switching field positions in Test has the same effect.

Example:

pub enum Foo {
    Bar,
    Baz(&'static str),
}

pub static TEST: Test = Test {
    foo: Bar,
    c: 'a'
};

pub struct Test {
    foo: Foo,
    c: char,
}

fn main() {
}

Error:

{ { i8, [23 x i8] }, i32 } { { i8, [23 x i8] } { i8 0, [23 x i8] undef }, i32 97 }
{ { i8, [7 x i8], [2 x i64] }, i32 } undef
error: internal compiler error: const expr(17: Test{foo: Bar, c: 'a',}) of type Test has size 28 instead of 32
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://static.rust-lang.org/doc/master/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace

Backtrace:

stack backtrace:
   1:     0x7f5a16de0230 - rt::backtrace::imp::write::h76ae436ab8cd2bfapZb::v0.10.pre
   2:     0x7f5a16d41a10 - rt::unwind::begin_unwind_inner::hf4375e02d9645bfaSzb::v0.10.pre
   3:     0x7f5a159ae830 - rt::unwind::begin_unwind::h3c590aa38e8709d1ok2::v0.10.pre
   4:     0x7f5a159af410 - diagnostic::Handler::bug::hf68c63085e9b6510YVb::v0.10.pre
   5:     0x7f5a177998e0 - driver::session::Session::bug::hfd0e2310310f12b7cih::v0.10.pre
   6:     0x7f5a1783bd80 - middle::trans::consts::const_expr::h43dc45f3937eaf8bFZi::v0.10.pre
   7:     0x7f5a177968c0 - middle::trans::base::get_item_val::h1e82e744da42398aqep::v0.10.pre
   8:     0x7f5a1783db50 - middle::trans::consts::trans_const::hf108c8e66bb317e7rNj::v0.10.pre
   9:     0x7f5a177956b0 - middle::trans::base::trans_item::h14eeb46ce9c8fca6uUo::v0.10.pre
  10:     0x7f5a178701d0 - middle::trans::base::trans_mod::hd916ddc9839c24eazZo::v0.10.pre
  11:     0x7f5a17879a20 - middle::trans::base::trans_crate::h4986f3f48477ce7b2vq::v0.10.pre
  12:     0x7f5a17f8db00 - driver::driver::phase_4_translate_to_llvm::had71317fbd14c5f8eHf::v0.10.pre
  13:     0x7f5a17f8fcd0 - driver::driver::compile_input::h396d5b0fd5bd11243Wf::v0.10.pre
  14:     0x7f5a17fb43f0 - run_compiler::h586972086a406218xAn::v0.10.pre
  15:     0x7f5a17fcb940 - main_args::closure.92068
  16:     0x7f5a17fca270 - monitor::closure.91953
  17:     0x7f5a17fc5ba0 - task::TaskBuilder::try::closure.91728
  18:     0x7f5a19d3c400 - task::spawn_opts::closure.7828
  19:     0x7f5a16ddb6c0 - rt::task::Task::run::closure.41627
  20:     0x7f5a16de6cd0 - rust_try
  21:     0x7f5a16ddb500 - rt::task::Task::run::hc847d6a2bcfd72f1os9::v0.10.pre
  22:     0x7f5a19d3c1d0 - task::spawn_opts::closure.7801
  23:     0x7f5a16dded70 - rt::thread::thread_start::he494c19e89c9f3eb569::v0.10.pre
  24:     0x7f5a140fafe0 - start_thread
  25:     0x7f5a16a0cce9 - clone
  26:                0x0 - <unknown>
@emberian emberian added the I-ICE label Mar 31, 2014
@arjantop
Copy link
Contributor Author

can be closed, no longer happens

@alexcrichton
Copy link
Member

Flagging as needstest

Sawyer47 added a commit to Sawyer47/rust that referenced this issue Jun 10, 2014
bors added a commit that referenced this issue Jun 11, 2014
matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this issue Sep 13, 2022
…, r=lnicola

Build release artifact against older Glibc

When GitHub [deprecated Ubuntu 18.04](https://github.blog/changelog/2022-08-09-github-actions-the-ubuntu-18-04-actions-runner-image-is-being-deprecated-and-will-be-removed-by-12-1-22/) runners, rust-analyzer was forced to bump runners to 20.04 which includes an updated Glib. This renders RA incompatible with the still popular Ubuntu 18.04 and other slightly older distro versions.

Until a deprecation plan is announced on RA's side, I propose binaries shall be built against older glibc to maintain compatibility.

This PR changes the Release CI workflow to build the `linux-x64/x86_64-unknown-linux-gnu` release in an Ubuntu 18.04 container.

Fixes rust-lang#13081 and rust-lang#13085
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants