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

internal compiler error: expected object type #17441

Closed
tilpner opened this issue Sep 22, 2014 · 3 comments
Closed

internal compiler error: expected object type #17441

tilpner opened this issue Sep 22, 2014 · 3 comments
Labels
A-dst Area: Dynamically Sized Types I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@tilpner
Copy link
Contributor

tilpner commented Sep 22, 2014

Upon fixing an old project to compile under the latest Rust, I encountered:

/tmp/redox-tween/src/lib.rs:100:9: 100:30 error: internal compiler error: expected object type
/tmp/redox-tween/src/lib.rs:100         CellAccess::new(self) as Access<T>
                                        ^~~~~~~~~~~~~~~~~~~~~

Backtrace:

task 'rustc' failed at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/libsyntax/diagnostic.rs:113
stack backtrace:
   1:     0x7f68f2c93f00 - rt::backtrace::imp::write::hb40e767174eadc9blLq
   2:     0x7f68f2c970c0 - failure::on_fail::hab6209505fea7a58N6q
   3:     0x7f68f738af80 - unwind::begin_unwind_inner::h3a7e8417aad82c7eMTd
   4:     0x7f68f3a41450 - unwind::begin_unwind::h2392538768877619269
   5:     0x7f68f3a413d0 - diagnostic::SpanHandler::span_bug::he7781fbb688ed22cudF
   6:     0x7f68f7ba3650 - driver::session::Session::span_bug::h5c6ded0cb05eac01TPx
   7:     0x7f68f7ef83d0 - middle::typeck::check::vtable2::check_object_cast::ha7b33ce543eddd8aJ2K
   8:     0x7f68f7f60fa0 - middle::typeck::check::check_cast::h6b4ba42c32c12f0fRXT
   9:     0x7f68f7f8a2e0 - middle::typeck::check::check_expr_with_unifier::hbcb91288bec55a2csXV
  10:     0x7f68f7f52700 - middle::typeck::check::check_block_with_expected::h2574fbf2342efdb2hbY
  11:     0x7f68f7f4d890 - middle::typeck::check::check_fn::h41bca712826f247fmDS
  12:     0x7f68f7f4d6a0 - middle::typeck::check::check_bare_fn::h854b4341f0f8841bpsS
  13:     0x7f68f7f568a0 - middle::typeck::check::check_method_body::h0680613c351d794bLaT
  14:     0x7f68f7f47620 - middle::typeck::check::check_item::he10ec73ffea798b14ZS
  15:     0x7f68f7f4cf40 - middle::typeck::check::check_item_types::h757d0292ac6a701dnrS
  16:     0x7f68f79f37d0 - util::common::time::h7040980569714169789
  17:     0x7f68f81f6250 - middle::typeck::check_crate::h3c78e9fb1a6da400cDk
  18:     0x7f68f825fc10 - driver::driver::phase_3_run_analysis_passes::h01e80bc9274a9fc096w
  19:     0x7f68f825af50 - driver::driver::compile_input::h644c4bcdb8d4fa416Nw
  20:     0x7f68f82dce40 - driver::run_compiler::hd9154f69e0f25652kFA
  21:     0x7f68f82dcd20 - driver::main_args::closure.146572
  22:     0x7f68f7a0ce70 - task::TaskBuilder<S>::try_future::closure.101814
  23:     0x7f68f7a0cc60 - task::TaskBuilder<S>::spawn_internal::closure.101785
  24:     0x7f68f76da540 - task::spawn_opts::closure.8457
  25:     0x7f68f73e1390 - rust_try_inner
  26:     0x7f68f73e1380 - rust_try
  27:     0x7f68f7388580 - unwind::try::haa9a6e4d3a3bf10cuId
  28:     0x7f68f73883e0 - task::Task::run::h18e39631c20de002cYc
  29:     0x7f68f76da2b0 - task::spawn_opts::closure.8397
  30:     0x7f68f7389fd0 - thread::thread_start::hfdbefd9910b77f41rid
  31:     0x7f68f203c250 - start_thread
  32:     0x7f68f70623b9 - clone
  33:                0x0 - <unknown>

Reproduce with

git clone https://github.com/hoeppnertill/redox-tween && cd redox-tween && git reset --hard bba1bddfe7f70151aa65bf1cbbb5550cfa1b9e81 && env RUST_BACKTRACE=1 cargo build

(Oh, and there's no need to criticize the code quality yet. Maybe when it's refactored...)

@steveklabnik steveklabnik added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Sep 22, 2014
@bkoropoff
Copy link
Contributor

Reduced test case:

fn main() {
    let _foo = 5u as std::fmt::Show;
}

This looks DST-related to me. cc @nick29581

@bkoropoff
Copy link
Contributor

I'll look into fixing this

@nrc nrc added the A-dst Area: Dynamically Sized Types label Sep 28, 2014
bkoropoff added a commit to bkoropoff/rust that referenced this issue Sep 29, 2014
This prevents ICEs or less helpful diagnostics if typeck proceeds
further.  Closes issue rust-lang#17441
bkoropoff added a commit to bkoropoff/rust that referenced this issue Sep 29, 2014
@alexcrichton
Copy link
Member

Closed by #17598

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

No branches or pull requests

5 participants