Skip to content

ICE using tuple containing a DST (1.14 stable & 1.16 nightly) #39117

@scottmcm

Description

@scottmcm
Member

The following code produces an internal compiler error:

pub fn ice() -> Box<(u32, [u8])> {
    unimplemented!()
}

From playground:

rustc 1.16.0-nightly (bf6d7b665 2017-01-15)
error: internal compiler error: /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/librustc_trans/type_of.rs:118: size differs (rustc: 4, llvm: 24) for type `(u32, [u8])` / Univariant {
    variant: Struct {
        align: Align {
            raw: 50
        },
        packed: false,
        sized: false,
        offsets: [
            Size {
                raw: 0
            },
            Size {
                raw: 4
            }
        ],
        memory_index: [
            0,
            1
        ],
        min_size: Size {
            raw: 4
        }
    },
    non_zero: false
}

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'Box<Any>', /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/librustc_errors/lib.rs:423
stack backtrace:
   1:     0x7f1bc941a6bc - std::sys::imp::backtrace::tracing::imp::write::h9c41d2f69e5caabf
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:42
   2:     0x7f1bc9428afe - std::panicking::default_hook::{{closure}}::hcc803c8663cda123
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libstd/panicking.rs:351
   3:     0x7f1bc94286a3 - std::panicking::default_hook::hd5bda4e453dfb4be
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libstd/panicking.rs:361
   4:     0x7f1bc9428f9b - std::panicking::rust_panic_with_hook::hffbc74969c7b5d87
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libstd/panicking.rs:555
   5:     0x7f1bc1a16a37 - std::panicking::begin_panic::he43dc5d9a599d346
   6:     0x7f1bc1a2c039 - rustc_errors::Handler::bug::h7088c6afc4a008fb
   7:     0x7f1bc674790a - rustc::session::opt_span_bug_fmt::{{closure}}::hfd034971cdf18ea9
   8:     0x7f1bc67473c5 - rustc::session::opt_span_bug_fmt::hc2cac313cb6d0020
   9:     0x7f1bc6747022 - rustc::session::bug_fmt::he01375c3004c5cfe
  10:     0x7f1bc8b588ab - rustc_trans::type_of::sizing_type_of::h4d7312d21836b0c7
  11:     0x7f1bc8ac3139 - rustc_trans::abi::FnType::unadjusted::h598b926ecccf5431
  12:     0x7f1bc8b19405 - rustc_trans::declare::declare_fn::h04a136a66996d898
  13:     0x7f1bc8b52f46 - rustc_trans::trans_item::TransItem::predefine::he9886853e5fcfedb
  14:     0x7f1bc8ad1f12 - rustc_trans::base::trans_crate::h496d157cb52a4b02
  15:     0x7f1bc97e20b0 - rustc_driver::driver::phase_4_translate_to_llvm::h106eb073675c3bee
  16:     0x7f1bc97b3e22 - rustc_driver::driver::compile_input::{{closure}}::heec508e3b0737586
  17:     0x7f1bc97d5541 - rustc_driver::driver::phase_3_run_analysis_passes::{{closure}}::haa13372f770e9055
  18:     0x7f1bc9733319 - rustc::ty::context::TyCtxt::create_and_enter::h6acd1d75709e85e8
  19:     0x7f1bc97b1dd0 - rustc_driver::driver::compile_input::h44853ffed84a12cb
  20:     0x7f1bc97f7034 - rustc_driver::run_compiler::hdc4bb0fcf7d0917a
  21:     0x7f1bc96fbc5b - std::panicking::try::do_call::h84a15e0d2b943318
  22:     0x7f1bc9431dda - __rust_maybe_catch_panic
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libpanic_unwind/lib.rs:98
  23:     0x7f1bc97259a2 - <F as alloc::boxed::FnBox<A>>::call_box::h61c78220cad685ea
  24:     0x7f1bc9427954 - std::sys::imp::thread::Thread::new::thread_start::h76badbf9b0ecaf58
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/liballoc/boxed.rs:615
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libstd/sys_common/thread.rs:21
                        at /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libstd/sys/unix/thread.rs:84
  25:     0x7f1bc11c16b9 - start_thread
  26:     0x7f1bc90de82c - clone
  27:                0x0 - <unknown>

Activity

est31

est31 commented on Jan 17, 2017

@est31
Member

Seems like a dupe of #34451

brson

brson commented on Jan 18, 2017

@brson
Contributor

Thanks for the report @scottmcm.

Closing in favor of the other.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @brson@est31@scottmcm

        Issue actions

          ICE using tuple containing a DST (1.14 stable & 1.16 nightly) · Issue #39117 · rust-lang/rust