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 destructuring unsized trait #19451

Closed
jdm opened this issue Dec 2, 2014 · 3 comments
Closed

ICE destructuring unsized trait #19451

jdm opened this issue Dec 2, 2014 · 3 comments
Labels
A-DSTs Area: Dynamically-sized types (DSTs) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@jdm
Copy link
Contributor

jdm commented Dec 2, 2014

trait Foo {
    fn send(&self);
}

impl Foo for Box<Foo+Send> {
    fn send(&self) {
        let foo: &Foo+Send = self;
        foo.send()
    }
}

fn main() {
}
godot2:tmp jdm$ rustc trace.rs
error: internal compiler error: trying to take the sizing type of Foo+Send, an unsized type
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' panicked at 'Box<Any>', /Users/rustbuild/src/rust-buildbot/slave/nightly-mac/build/src/libsyntax/diagnostic.rs:175
stack backtrace:
   1:        0x10d37b01f - rt::backtrace::imp::write::h8b16685522a2f37e6mt
   2:        0x10d37e1a7 - failure::on_fail::hda0872f4f7b4d652VDt
   3:        0x10d605375 - unwind::begin_unwind_inner::hc18b427b17a69549j1c
   4:        0x10cab0447 - unwind::begin_unwind::h16775218699497008092
   5:        0x10cab0c83 - diagnostic::Handler::bug::he58e2d0573e8d5d4L5F
   6:        0x10a3a1124 - middle::trans::type_of::sizing_type_of::hee62b0bc8796e7a7kic
   7:        0x10a3cd876 - middle::trans::meth::get_vtable::ha051d60ffab0f8ac4rn
   8:        0x10a3ccd80 - middle::trans::expr::apply_adjustments::unsized_info::hbe2033da4ea81f18Sx5
   9:        0x10a3cf0ee - middle::trans::expr::apply_adjustments::unsize_expr::closure.124053
  10:        0x10a3cf33f - middle::trans::expr::apply_adjustments::into_fat_ptr::heb413f79fd24594dcF5
  11:        0x10a3cc356 - middle::trans::expr::apply_adjustments::apply_autoref::hbd93c446aa47d112Pk5
  12:        0x10a3cbc13 - middle::trans::expr::apply_adjustments::apply_autoref::hbd93c446aa47d112Pk5
  13:        0x10a390cbb - middle::trans::expr::trans::h4434d528fe04df5eT84
  14:        0x10a38ec88 - middle::trans::expr::trans_into::h1af41bae8ee0dffbZ44
  15:        0x10a457f1e - middle::trans::_match::store_local::closure.127694
  16:        0x10a457c5f - middle::trans::_match::mk_binding_alloca::h4744195066849425184
  17:        0x10a4285bf - middle::trans::_match::store_local::h0bb5c8564f1380cfN0k
  18:        0x10a38e474 - middle::trans::base::init_local::h05a9a3792652d0c7bCg
  19:        0x10a38d8e1 - middle::trans::controlflow::trans_stmt::h6fdddbb12673cd46yg1
  20:        0x10a38f0e8 - middle::trans::controlflow::trans_block::h6a4e65c7668581e0El1
  21:        0x10a430cf2 - middle::trans::base::trans_closure::hc2af7384d279c318Gwh
  22:        0x10a382b3c - middle::trans::base::trans_fn::hb749e580083af661tIh
  23:        0x10a432b1b - middle::trans::meth::trans_impl::h35da4da3ba6b6e7dhRm
  24:        0x10a3806dd - middle::trans::base::trans_item::h43f06cde27601092H1h
  25:        0x10a4399b9 - middle::trans::base::trans_crate::h3cf75d0bc692f6c9IZi
  26:        0x10a8a82b5 - driver::driver::phase_4_translate_to_llvm::hc964ebcd6d51be4bcoC
  27:        0x10a8a1c92 - driver::driver::compile_input::hbe7ec99668ca396f6UB
  28:        0x10a91e44d - driver::run_compiler::h28311042d2d2d716nLF
  29:        0x10a91c98e - driver::run::closure.146343
  30:        0x10a055feb - task::TaskBuilder<S>::try_future::closure.104775
  31:        0x10a055ee3 - task::TaskBuilder<S>::spawn_internal::closure.104746
  32:        0x10a00f7bd - task::NativeSpawner.Spawner::spawn::closure.2553
  33:        0x10d6639cc - rust_try_inner
  34:        0x10d6639b6 - rust_try
  35:        0x10d602b47 - unwind::try::he8226cb3f62b8c951Pc
  36:        0x10d6029dc - task::Task::run::h4878cb7b665069bf61b
  37:        0x10a00f5e3 - task::NativeSpawner.Spawner::spawn::closure.2477
  38:        0x10d604207 - thread::thread_start::h8e83ad43ae75daab3mc
  39:     0x7fff9a0b1899 - _pthread_body
  40:     0x7fff9a0b172a - _pthread_struct_init
@jdm jdm added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Dec 2, 2014
@flaper87
Copy link
Contributor

@nick29581 does the above ring a bell?

@nrc nrc added the A-DSTs Area: Dynamically-sized types (DSTs) label Dec 13, 2014
@nrc
Copy link
Member

nrc commented Dec 13, 2014

Yeah, DST bug, I'll add it to my TODO list

@nrc
Copy link
Member

nrc commented Dec 15, 2014

This has been fixed. I'm not exactly sure what by, but there have been a few DST fixes landed recently, they all had tests, so I don't think we need another here.

@nrc nrc closed this as completed Dec 15, 2014
nikomatsakis added a commit to nikomatsakis/rust that referenced this issue Dec 31, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-DSTs Area: Dynamically-sized types (DSTs) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

3 participants