Issue 1:
I'm in Arch Linux x86_64

This is the repository and branch where the bug in question happened: https://github.com/Denommus/xpath-rs/tree/rust-bug

After some study, I found out the smallest code that causes the issue:

use std::kinds::marker::ContravariantLifetime;

struct Foo<'a> {
foo: *const int,
lf: ContravariantLifetime<'a>
}

impl<'a> Drop for Foo<'a> {
fn drop(&mut self) {
}
}

When trying to cargo build or cargo test it, I get the following error:

Compiling xpath v0.1.0 (file:/home/yuri/Projetos/PistonDevelopers/xpath-rs)
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. 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' failed at 'index out of bounds: the len is 0 but the index is 0', /build/rust-git/src/rust/src/librustc/middle/subst.rs:405

stack backtrace:
1: 0x7fd280653440 - rt::backtrace::imp::write::hd9494d95b8843aac9Mp
2: 0x7fd280656ca0 - <unknown>
3: 0x7fd280e11660 - unwind::begin_unwind_inner::h86c91288dccdf7edcZd
4: 0x7fd280e112b0 - unwind::begin_unwind_fmt::h1cb579d85bd16aefFWd
5: 0x7fd280e11270 - rust_begin_unwind
6: 0x7fd280e4cde0 - failure::begin_unwind::h4bcdf2c748255fc2srj
7: 0x7fd280e50670 - failure::fail_bounds_check::hdab871e57fe12ae2Epj
8: 0x7fd281564060 - <unknown>
9: 0x7fd281564020 - <unknown>
10: 0x7fd281562b30 - <unknown>
11: 0x7fd281562960 - <unknown>
12: 0x7fd28150af40 - middle::subst::SubstFolder<'a>.TypeFolder::fold_ty::h13798902dd9366ecRMU
13: 0x7fd28150ae50 - <unknown>
14: 0x7fd281685fd0 - middle::ty::lookup_field_type::h45aac711c7fa1076qeS
15: 0x7fd281547e60 - middle::ty::struct_fields::hb5d9b2dc874148eeHmS
16: 0x7fd2816b10e0 - <unknown>
17: 0x7fd28164e5d0 - middle::ty::type_contents::hc7f87097be3796b7AsP
18: 0x7fd2819fa0d0 - <unknown>
19: 0x7fd2819fcfc0 - middle::kind::check_crate::h567230afc53cc6d1sxQ
20: 0x7fd281d2da50 - driver::driver::phase_3_run_analysis_passes::h6dd6f772dd74de516Eq
21: 0x7fd281d28eb0 - driver::driver::compile_input::h74d2c1dd617400e9Mrq
22: 0x7fd281ddf670 - <unknown>
23: 0x7fd281ddf580 - <unknown>
24: 0x7fd281df2dd0 - <unknown>
25: 0x7fd281df2b60 - <unknown>
26: 0x7fd283e0ff80 - <unknown>
27: 0x7fd280e60dc0 - rust_try
28: 0x7fd280e0e6e0 - unwind::try::h62bccd25ee1c5a2dBNd
29: 0x7fd280e0e440 - task::Task::run::h899cbe26c861f39cXYc
30: 0x7fd283e0fd70 - <unknown>
31: 0x7fd280e106c0 - <unknown>
32: 0x7fd2800da060 - start_thread
33: 0x7fd280ad9489 - __clone
34: 0x0 - <unknown>

Could not execute process `rustc src/lib.rs --crate-name xpath --crate-type lib -g --test --out-dir /home/yuri/Projetos/PistonDevelopers/xpath-rs/target/test -L /home/yuri/Projetos/PistonDevelopers/xpath-rs/target/test -L /home/yuri/Projetos/PistonDevelopers/xpath-rs/target/test/deps` (status=101)

Issue 2:
Compiling this program results in the following error with rustc 00cdd63,

$ RUST_LOG=rustc::middle::kind,rustc::middle::typeck::astconv RUST_BACKTRACE=1 /opt/exp/rust/x86_64-unknown-linux-gnu/stage1/bin/rustc crash.rs
InterDEBUG:rustc::middle::typeck::astconv: ast_region_to_region(lifetime='a id=8) yields ReEarlyBound(12, TypeSpace, 0, 'a)
DEBUG:rustc::middle::typeck::astconv: opt_ast_region_to_region(opt_lifetime=Some('a)) yields ReEarlyBound(12, TypeSpace, 0, 'a)
DEBUG:rustc::middle::typeck::astconv: ty_rptr r=ReEarlyBound(12, TypeSpace, 0, 'a)
DEBUG:rustc::middle::typeck::astconv: mk_pointer(ptr_ty=RPtr(ReEarlyBound(12u32, TypeSpace, 0u, syntax::ast::Name(58u32))))
DEBUG:rustc::middle::typeck::astconv: ast_region_to_region(lifetime='a id=18) yields ReEarlyBound(14, TypeSpace, 0, 'a)
DEBUG:rustc::middle::typeck::astconv: ty_of_method_or_bare_fn
DEBUG:rustc::middle::typeck::astconv: opt_ast_region_to_region(opt_lifetime=None) yields ReLateBound(19, BrAnon(0))
DEBUG:rustc::middle::typeck::astconv: ty_of_method_or_bare_fn
DEBUG:rustc::middle::kind: checking impl with self type ty_struct(DefId { krate: 0, node: 5 }, Substs { types: VecPerParamSpace {TypeSpace: [], SelfSpace: [], FnSpace: [], }, regions: NonerasedRegions(VecPerParamSpace {TypeSpace: [ReEarlyBound(14, TypeSpace, 0, Name(58))], SelfSpace: [], FnSpace: [], }) })
crash.rs:1:1: 1:1 error: internal compiler error: Type parameter out of range when substituting in region 'a (root type='au32)
crash.rs:1 use std::ty::Unsafe;

task 'rustc' failed at 'Box<Any>', /opt/exp/rust/src/libsyntax/diagnostic.rs:107

stack backtrace:
1: 0x7fc9e8922840 - rt::backtrace::imp::write::h0a20b0836877d9ac0Mp::v0.11.0
2: 0x7fc9e89260a0 - failure::on_fail::h9368950ceb08d6a5f8p::v0.11.0
3: 0x7fc9e90f7eb0 - unwind::begin_unwind_inner::h1ea00938b93c7417cZd::v0.11.0
4: 0x7fc9e75bf9a0 - unwind::begin_unwind::h12621653176727986714::v0.11.0
5: 0x7fc9e75bf8d0 - diagnostic::SpanHandler::span_bug::h4bae981243ffc58eMac::v0.11.0
6: 0x7fc9e990c470 - driver::session::Session::span_bug::hc179e601dc679fecYos::v0.11.0
7: 0x7fc9e991d800 - middle::subst::SubstFolder<'a>.TypeFolder::fold_region::he5ebd51cee9a84b33rV::v0.11.0
8: 0x7fc9e98c4270 - middle::subst::SubstFolder<'a>.TypeFolder::fold_ty::h59e6cfaf115bff0ahuV::v0.11.0
9: 0x7fc9e98c4180 - middle::subst::T.Subst::subst_spanned::h16361762956049246516::v0.11.0
10: 0x7fc9e9a45830 - middle::ty::lookup_field_type::h3e7b27996e88cd1bHMS::v0.11.0
11: 0x7fc9e9901c90 - middle::ty::struct_fields::h729f0dbbcf21bf37YUS::v0.11.0
12: 0x7fc9e9a71fd0 - middle::ty::type_contents::tc_ty::h7d685e11e712e8a6V1P::v0.11.0
13: 0x7fc9e9a0a250 - middle::ty::type_contents::h8e510766cec98181R0P::v0.11.0
14: 0x7fc9e9dbefd0 - middle::kind::check_item::hfa5461b803c6c40dwpR::v0.11.0
15: 0x7fc9e9dc1ed0 - middle::kind::check_crate::h70941b58fca9fc5bVfR::v0.11.0
16: 0x7fc9ea0edfd0 - driver::driver::phase_3_run_analysis_passes::hd94ede6fcda9089cznr::v0.11.0
17: 0x7fc9ea0e9750 - driver::driver::compile_input::h22443fcf4e1357eafar::v0.11.0
18: 0x7fc9ea1a0140 - driver::run_compiler::hd0a576aeaeea68b3W0t::v0.11.0
19: 0x7fc9ea1a0050 - driver::main_args::closure.127086
20: 0x7fc9ea1b4560 - task::TaskBuilder<S>::try_future::closure.128230
21: 0x7fc9ea1b4230 - task::TaskBuilder<S>::spawn_internal::closure.128207
22: 0x7fc9ec193d00 - task::spawn_opts::closure.7759
23: 0x7fc9e9252e60 - rust_try
24: 0x7fc9e90f4490 - unwind::try::hb071379e55686597BNd::v0.11.0
25: 0x7fc9e90f4190 - task::Task::run::ha6ba4f51b8a2758dXYc::v0.11.0
26: 0x7fc9ec193ac0 - task::spawn_opts::closure.7705
27: 0x7fc9e90f6ce0 - thread::thread_start::hc20479a5894ce695vld::v0.11.0
28: 0x7fc9e83a40c0 - start_thread
29: 0x7fc9e8dbb2d9 - __clone
30: 0x0 - <unknown>