Issue 1:
rustc panics with the following backtrace when building this fork of rlibc. I can't even tell which line of my code is causing it, but it occurs after most of the warnings are printed:

...
src/posix/fcntl.rs:6:62: 6:66 warning: unused variable: `mode`, #[warn(unused_variables)] on by default
src/posix/fcntl.rs:6 pub unsafe extern fn open(path: *const char_t, flags: int_t, mode: mode_t) -> int_t {
^~~~
error: internal compiler error: unexpected panic
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 'Trying to convert unsized value to lval', /Users/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-mac/build/src/librustc_trans/trans/datum.rs:495

stack backtrace:
1: 0x112612be3 - sys::backtrace::write::h918207864656307b0nC
2: 0x112640be5 - panicking::on_panic::h2c4b1456225ae37fnPL
3: 0x11256a418 - rt::unwind::begin_unwind_inner::h6c7f1344c68dd4a7AwL
4: 0x10ea6dc45 - rt::unwind::begin_unwind::h4082345751407454387
5: 0x10eaec56f - trans::datum::Datum<'tcx, Expr>::to_lvalue_datum::h4809841e9861f286hYf
6: 0x10eb20dd5 - trans::expr::trans_index::h56dd6242817519cf6Ei
7: 0x10eb0d9c9 - trans::expr::trans_unadjusted::h8c78f89bb783464csqi
8: 0x10eac21d0 - trans::expr::trans::h25c26cd42d9241e1HMh
9: 0x10eb237e3 - trans::expr::trans_addr_of::h5be1b2f119f51174rNj
10: 0x10eb0dbd7 - trans::expr::trans_unadjusted::h8c78f89bb783464csqi
11: 0x10eac21d0 - trans::expr::trans::h25c26cd42d9241e1HMh
12: 0x10eafdba5 - trans::callee::trans_args::hc52bfad7cdf49353xjh
13: 0x10eb048fc - trans::callee::trans_call_inner::h5306915459861161960
14: 0x10eb0fdaa - trans::expr::trans_rvalue_dps_unadjusted::hb1406d54d45518409Wi
15: 0x10eb0d642 - trans::expr::trans_unadjusted::h8c78f89bb783464csqi
16: 0x10eac21d0 - trans::expr::trans::h25c26cd42d9241e1HMh
17: 0x10eb22c0c - trans::expr::trans_unary::h509c840b305ef674LFj
18: 0x10eb0dbc0 - trans::expr::trans_unadjusted::h8c78f89bb783464csqi
19: 0x10eac0a0b - trans::expr::trans_into::h0f31dfb1ff207cd8pGh
20: 0x10ebb5fd7 - trans::_match::trans_match_inner::h56e2641ee60bee0daMx
21: 0x10eb0f1b3 - trans::expr::trans_rvalue_dps_unadjusted::hb1406d54d45518409Wi
22: 0x10eac09eb - trans::expr::trans_into::h0f31dfb1ff207cd8pGh
23: 0x10eac17fa - trans::controlflow::trans_block::hb675814db44e1ef35ee
24: 0x10eb982bf - trans::base::trans_closure::h1fc9dae5b42c150ephu
25: 0x10eaac086 - trans::base::trans_fn::h1baa1a79c6642379Gsu
26: 0x10eaa6fc9 - trans::base::trans_item::h99ee5fcee3ea0222zRu
27: 0x10eb99a89 - trans::base::trans_mod::h0f4f7f5d04ce3f65yXu
28: 0x10eaa70dd - trans::base::trans_item::h99ee5fcee3ea0222zRu
29: 0x10eb9ee0c - trans::base::trans_crate::h89e3520c5dfd05b21Ov
30: 0x10e92d058 - driver::phase_4_translate_to_llvm::h5a7c1f8c7ec04632qPa
31: 0x10e907f72 - driver::compile_input::h32723f720e0c3c95Gba
32: 0x10e9e08a7 - run_compiler::hfdf8469da778a8d4Zbc
33: 0x10e9ddd21 - thunk::F.Invoke<A, R>::invoke::h56535309890628509
34: 0x10e9dc980 - rt::unwind::try::try_fn::h6830563953582217021
35: 0x1126ba7e9 - rust_try_inner
36: 0x1126ba7d6 - rust_try
37: 0x10e9dd0e5 - thunk::F.Invoke<A, R>::invoke::h12775416177659868106
38: 0x112629ac3 - sys::thread::thread_start::hccc0587963a6c50bU4G
39: 0x7fff8cc79268 - _pthread_body
40: 0x7fff8cc791e5 - _pthread_body

make: *** [target/x86_64-apple-darwin/c.o] Error 101

Issue 2:
I got this compiling a fairly large app:

error: internal compiler error: unexpected panic
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
thread 'rustc' panicked at 'Trying to convert unsized value to lval', /Users/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-mac/build/src/librustc_trans/trans/datum.rs:402

stack backtrace:
1: 0x10c85ecd7 - sys::backtrace::write::h4ee5c5ad264b65f5mbu
2: 0x10c884e9c - failure::on_fail::h55e5ff39107f11fcHbB
3: 0x10c7e6618 - rt::unwind::begin_unwind_inner::habba3c5d37f59591DTA
4: 0x10904eca5 - rt::unwind::begin_unwind::h5615917778268573803
5: 0x1090d753e - trans::datum::Datum<'tcx, Expr>::to_lvalue_datum::h9595aad7c2992d4cZSf
6: 0x1090feaac - trans::expr::trans_index::h33588fb9dd7ce121yzi
7: 0x1090e75a3 - trans::expr::trans_unadjusted::h4bfe4622405612c0Vki
8: 0x10909f7d4 - trans::expr::trans::h87900629b98dec94YCh
9: 0x109101448 - trans::expr::trans_addr_of::he4d93cb9897bf566uHj
10: 0x1090e779e - trans::expr::trans_unadjusted::h4bfe4622405612c0Vki
11: 0x10909f7d4 - trans::expr::trans::h87900629b98dec94YCh
12: 0x10909e521 - trans::expr::trans_into::h8d099f5179d39277uzh
13: 0x10911d773 - trans::expr::trans_adt::h04652ea6bac31317Drj
14: 0x1090b0cdf - trans::base::trans_named_tuple_constructor::h27bf054814ac4386Dcu
15: 0x1090e25a6 - trans::callee::trans_call_inner::h12337891083913942824
16: 0x1090e9b77 - trans::expr::trans_rvalue_dps_unadjusted::h76d104b0c393ded0ITi
17: 0x10909e762 - trans::expr::trans_into::h8d099f5179d39277uzh
18: 0x10909f339 - trans::controlflow::trans_block::ha4c3bc4d960bd55aT3d
19: 0x1090e8c91 - trans::expr::trans_rvalue_dps_unadjusted::h76d104b0c393ded0ITi
20: 0x10909e762 - trans::expr::trans_into::h8d099f5179d39277uzh
21: 0x10909f339 - trans::controlflow::trans_block::ha4c3bc4d960bd55aT3d
22: 0x10916c644 - trans::base::trans_closure::hc2f7f2fc0f6c7df0WXt
23: 0x10908b1c9 - trans::base::trans_fn::he8bb083f0eb63cd3Q8t
24: 0x109086f0b - trans::base::trans_item::h6e886ccbd5f66d227vu
25: 0x10916de29 - trans::base::trans_mod::hacffe7d798632c0cIBu
26: 0x10908664e - trans::base::trans_item::h6e886ccbd5f66d227vu
27: 0x109172a8c - trans::base::trans_crate::h03f93f510f95d199hrv
28: 0x108f29f6e - driver::phase_4_translate_to_llvm::hf01e1f3e6069eac9mOa
29: 0x108f05f3c - driver::compile_input::h8e0204b8bb9ea44bBba
30: 0x108fced3e - run_compiler::h322f9334a9a1d7e6l9b
31: 0x108fcbd7f - thunk::F.Invoke<A, R>::invoke::h14356237310415989951
32: 0x108fcaa10 - rt::unwind::try::try_fn::h798029436104877783
33: 0x10c8fb329 - rust_try_inner
34: 0x10c8fb316 - rust_try
35: 0x108fcb0d4 - thunk::F.Invoke<A, R>::invoke::h15628186897385384602
36: 0x10c86f553 - sys::thread::thread_start::h3f48e8c893476626A3w
37: 0x7fff854c5899 - _pthread_body
38: 0x7fff854c572a - _pthread_struct_init

The problem appears to be in this function:

pub fn chunk_containing(&self, abs_x: u32, abs_y: u32) -> Option<&Chunk> {
// x_idx and y_idx are indices int the chunks array.
let x_idx: usize = abs_x.div_floor(&self.chunk_x_size) as usize;
let y_idx: usize = abs_y.div_floor(&self.chunk_y_size) as usize;

if ((x_idx as u32) < self.x_chunks && (y_idx as u32) < self.y_chunks) {
Some(&self.chunks[y_idx][x_idx])
} else {
None
}
}

And specifically, the problem appears to be this line:

Some(&self.chunks[y_idx][x_idx])

I reached that conclusion because replacing the above line with None clears the error. The type of self.chunks is [[Chunk]]. Changing its type to Vec<Vec<Chunk>> also clears the error.

OSX 10.9.5

rustc 1.0.0-nightly (1d00c54 2015-01-30 19:56:34 +0000)

binary: rustc

commit-hash: 1d00c54

commit-date: 2015-01-30 19:56:34 +0000

host: x86_64-apple-darwin

release: 1.0.0-nightly