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

Problem with Owned Boxes #6

Open
bytesnake opened this issue Apr 18, 2014 · 1 comment
Open

Problem with Owned Boxes #6

bytesnake opened this issue Apr 18, 2014 · 1 comment

Comments

@bytesnake
Copy link

Hi, rustc gives me a strange error if I'm trying to allocate an owned box,
it seems like rust hasn't any idea about the type which is requested ...

http://static.rust-lang.org/doc/0.10/src/rustc/home/rustbuild/src/rust-buildbot/slave/dist2-linux/build/src/librustc/middle/trans/type_of.rs.html#282

let a: ~u8 = ~42;

Getting:

error: internal compiler error: type_of with ty_param
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
task 'rustc' failed at '~Any', /build/rust/src/rust-0.10/src/libsyntax/diagnostic.rs:123
stack backtrace:
   1:     0x7f57cc8144e0 - rt::backtrace::imp::write::hd3c2755a219a6730gZb::v0.10
   2:     0x7f57cc775cd0 - rt::unwind::begin_unwind_inner::hd04ee43a7df64e91Jzb::v0.10
   3:     0x7f57cb601ca0 - <unknown>
   4:     0x7f57cb602880 - diagnostic::Handler::bug::h6603a56cf733bd1eYVb::v0.10
   5:     0x7f57cd1d2a20 - driver::session::Session::bug::haab9bed737653edaDhh::v0.10
   6:     0x7f57cd20fad0 - middle::trans::type_of::type_of::h2e2847dca79d48eeBXj::v0.10
   7:     0x7f57cd20fad0 - middle::trans::type_of::type_of::h2e2847dca79d48eeBXj::v0.10
   8:     0x7f57cd27ff40 - middle::trans::type_of::type_of_rust_fn::h21848b2aa25e3975GPj::v0.10
   9:     0x7f57cd296f60 - middle::trans::base::decl_rust_fn::h31fc7132f69813ba1Zm::v0.10
  10:     0x7f57cd2ab190 - <unknown>
  11:     0x7f57cd1cfa00 - middle::trans::base::get_item_val::h546e22b45841695alep::v0.10
  12:     0x7f57cd22a090 - middle::trans::callee::trans_fn_ref_with_vtables::h1aefbd315afc02079jd::v0.10
  13:     0x7f57cd234a50 - <unknown>
  14:     0x7f57cd231100 - middle::trans::callee::trans_call_inner::h7fd65b79c47d6622aKd::v0.10
  15:     0x7f57cd20c5d0 - middle::trans::callee::trans_lang_call::hec5ba9c33468defclGd::v0.10
  16:     0x7f57cd20d0c0 - middle::trans::glue::trans_exchange_free::h77600c567c2fc4dbzsb::v0.10
  17:     0x7f57cd21a750 - middle::trans::base::with_cond::h161ee669dac54f39s9n::v0.10
  18:     0x7f57cd212be0 - <unknown>
  19:     0x7f57cd2124c0 - <unknown>
  20:     0x7f57cd20f240 - middle::trans::glue::get_drop_glue::hda4485ab65bb20daeyb::v0.10
  21:     0x7f57cd20efc0 - middle::trans::glue::drop_ty::he02755e403fc6bf7Uvb::v0.10
  22:     0x7f57cd201860 - middle::trans::cleanup::FunctionContext$LT$$x27a$GT$.CleanupMethods$LT$$x27a$GT$::pop_and_trans_ast_cleanup_scope::h679e6bebc605780cHCF::v0.10
  23:     0x7f57cd201c10 - middle::trans::controlflow::trans_block::h27d861b2c0e3c1fcg2a::v0.10
  24:     0x7f57cd2a47e0 - middle::trans::base::trans_closure::ha7af676dea5ed3450Ao::v0.10
  25:     0x7f57cd1d3890 - middle::trans::base::trans_fn::h6d528e71241ec959OIo::v0.10
  26:     0x7f57cd1ce7d0 - middle::trans::base::trans_item::ha2e98f90ac18978fpUo::v0.10
  27:     0x7f57cd2a91f0 - middle::trans::base::trans_mod::h70be4be71d9acdd1uZo::v0.10
  28:     0x7f57cd1ce7d0 - middle::trans::base::trans_item::ha2e98f90ac18978fpUo::v0.10
  29:     0x7f57cd2a91f0 - middle::trans::base::trans_mod::h70be4be71d9acdd1uZo::v0.10
  30:     0x7f57cd2b2a40 - middle::trans::base::trans_crate::hefba93dabc9e4a62Xvq::v0.10
  31:     0x7f57cd9c6ed0 - driver::driver::phase_4_translate_to_llvm::h03114552db920090DGf::v0.10
  32:     0x7f57cd9c90a0 - driver::driver::compile_input::hb78836dd16d0c5b8sWf::v0.10
  33:     0x7f57cd9ed700 - run_compiler::hfbfadce32e0a84c5Yzn::v0.10
  34:     0x7f57cda04c50 - <unknown>
  35:     0x7f57cda03580 - <unknown>
  36:     0x7f57cd9feeb0 - <unknown>
  37:     0x7f57cf718000 - <unknown>
  38:     0x7f57cc80f970 - <unknown>
  39:     0x7f57cc81af80 - rust_try
  40:     0x7f57cc80f7b0 - rt::task::Task::run::hd67f170816441df1fs9::v0.10
  41:     0x7f57cf717dd0 - <unknown>
  42:     0x7f57cc813020 - <unknown>
  43:     0x7f57c9b34fe0 - start_thread
  44:     0x7f57cc443ce9 - clone
  45:                0x0 - <unknown>
@pczarn
Copy link
Owner

pczarn commented Apr 18, 2014

@bytesnake Hi, the declaration of exchange_free in kernel/heap.rsis not accepted by Rust. A valid declaration is:

pub unsafe fn free(ptr: *mut u8)

I'm fixing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants