Issue 1:
In the playpen (Mode: Debug, Channel: Nightly)

I was playing with associated constants when this code made the compiler panic:

#![feature(associated_consts)]

use ::std::marker::PhantomData;

trait Num {
const VAL: usize;
fn val() -> usize;
}

struct N1;
impl Num for N1 {
const VAL: usize = 1;
fn val() -> usize { N1::VAL }
}

struct Arr<S: Num> {
ty: PhantomData<S>,
data: [i32; S::VAL]
}

fn main() {
}

With error message:

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 'path not fully resolved: PathResolution { base_def: DefTyParam(TypeSpace, 0, DefId { krate: 0, node: 35 }, "S"(72)), last_private: LastMod(AllPublic), depth: 1 }', ../src/librustc/middle/def.rs:81

playpen: application terminated with error code 101

Playpen link: http://is.gd/dE8jbq

The line which confuses the compiler is this one:

data: [i32; S::VAL]

Without it, the program compiles just fine.

Issue 2:
The following code causes an ICE using the latest nightly.

#![feature(associated_consts)]

pub trait Test {
const LENGTH: usize;

fn method(array: [i32; Self::LENGTH]) { }

}

fn main() { }

Running with RUST_BACKTRACE=1 gives

thread 'rustc' panicked at 'path not fully resolved: PathResolution { base_def: DefSelfTy(Some(DefId { krate: 0, node: 4 }Test), None), last_private: LastMod(AllPublic), depth: 1 }', ../src/librustc/middle/def.rs:81

stack backtrace:
1: 0x7fcb00fecdde - sys::backtrace::write::h69183b7c98049b30wqs
2: 0x7fcb00ff4a44 - panicking::on_panic::h2c3150d5b218c447i8w
3: 0x7fcb00fb77ee - rt::unwind::begin_unwind_inner::hf9bdd075490425c8WNw
4: 0x7fcb00fb851c - rt::unwind::begin_unwind_fmt::h6a9238aa2a13c0892Mw
5: 0x7fcaff01d717 - middle::const_eval::eval_const_expr_with_substs::h14003455026798805522
6: 0x7fcafefca59b - middle::const_eval::eval_const_expr_partial::hfb624d4880a32ba3IGk
7: 0x7fcb007d5cf2 - astconv::ast_ty_to_ty::heeb2edb80837d1162Qv
8: 0x7fcb008317ee - vec::Vec<T>.FromIterator<T>::from_iter::h3785597557409810636
9: 0x7fcb00830d56 - astconv::ty_of_method_or_bare_fn::h7fc2677ba2149d77I6v
10: 0x7fcb00849e9b - collect::convert_method::h2213f9f8b79b70d9Fsx
11: 0x7fcb00838e74 - collect::convert_item::hbcf9d38ceb0aafd0cIx
12: 0x7fcb00833917 - collect::collect_item_types::hacdb13c97b5df6d8zPw
13: 0x7fcb00880a59 - check_crate::h0321f1e753acbcf9WWC
14: 0x7fcb01555cd9 - driver::phase_3_run_analysis_passes::closure.15875
15: 0x7fcb0155461b - middle::ty::ctxt<'tcx>::create_and_enter::h9079099211582893073
16: 0x7fcb0154f5c1 - driver::phase_3_run_analysis_passes::h12132907910932298086
17: 0x7fcb0152e83c - driver::compile_input::h3a475b0b9259362fTba
18: 0x7fcb01614bd3 - run_compiler::h2cc1d87c2af5b2f0A7b
19: 0x7fcb016125ae - boxed::F.FnBox<A>::call_box::h6791803627395147597
20: 0x7fcb01611df9 - rt::unwind::try::try_fn::h10416075533806878094
21: 0x7fcb0106f738 - rust_try_inner
22: 0x7fcb0106f725 - rust_try
23: 0x7fcb00fe00f7 - rt::unwind::try::inner_try::h6181b0bb7448f551PJw
24: 0x7fcb0161200b - boxed::F.FnBox<A>::call_box::h6862050082343839214
25: 0x7fcb00ff36a1 - sys::thread::Thread::new::thread_start::hadfe7238e1724c34CTv
26: 0x7fcafac580a3 - start_thread
27: 0x7fcb00c3e04c - clone
28: 0x0 - <unknown>

$ rustc --version --verbose
rustc 1.3.0-nightly (16f64c388 2015-07-09)
binary: rustc
commit-hash: 16f64c38803e820fc20a669987395e663ced1387
commit-date: 2015-07-09
host: x86_64-unknown-linux-gnu
release: 1.3.0-nightly

This might be a duplicate of #24938 (although that issue is now closed) or #26402.