Issue 1:
I came across this failure while trying to implement double dispatch. Here's the reduced code to reproduce it:

pub trait MatBase {
// Base method for double dispatch.
// Performs: MatBase * f32
fn mul_scalar(&self, scalar: &f32) -> Mat {
Mat::new()
}

// Base method for double dispatch.
// Performs: MatBase * MatBase
fn mul_mat<T:MatBase>(&self, rhs: &T) -> Mat {
Mat::new()
}
}

pub struct Mat {
pub r: uint,
}

impl Mat {
pub fn new() -> Mat {
Mat {r: 0}
}
}

impl MatBase for Mat {
}

impl<T:MatBase, U: LMulMatBase> Mul<U, Mat> for T {
fn mul(&self, rhs: &U) -> Mat {
rhs.lmul_matbase(self)
}
}

// Trait for double dispatch. Called for `MatBase * X`
trait LMulMatBase {
fn lmul_matbase<T:MatBase>(&self, &T) -> Mat;
}

impl LMulMatBase for f32 {
fn lmul_matbase<T:MatBase>(&self, rhs: &T) -> Mat {
rhs.mul_scalar(self)
}
}

impl<U:MatBase> LMulMatBase for U {
fn lmul_matbase<T:MatBase>(&self, rhs: &T) -> Mat {
rhs.mul_mat(self)
}
}

pub fn generate_ice() {
let v = Mat::new();

// ICE
let foo = v * 2.0;
let bar = v * 2;
}

fn main() {
}

Produces...

ice.rs:31:5: 33:6 error: method `mul` has an incompatible type for trait: expected type parameter, found &-ptr [E0053]
ice.rs:31 fn mul(&self, rhs: &U) -> Mat {
ice.rs:32 rhs.lmul_matbase(self)
ice.rs:33 }
error: internal compiler error: Impl DefId { krate: 0, node: 104 }:f32.LMulMatBase was matchable against Obligation(trait_ref=<_ : LMulMatBase>,depth=1) but now is not
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>', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/libsyntax/diagnostic.rs:188

stack backtrace:
1: 0x7f7baf436c60 - rt::backtrace::imp::write::hb0dcc4a5fc17fd0bFUx
2: 0x7f7baf43a030 - failure::on_fail::hcd3ce97bacbef1b03ly
3: 0x7f7baf07a790 - unwind::begin_unwind_inner::h670ccdf2c60477f7aNc
4: 0x7f7bac76e010 - unwind::begin_unwind::h18115787115103468845
5: 0x7f7bac76e8c0 - diagnostic::Handler::bug::h266854e4787d0d95KHF
6: 0x7f7bad6be650 - middle::traits::select::SelectionContext<'cx, 'tcx>::rematch_impl::h85fa8dd1c7168e08QsZ
7: 0x7f7bad6b22b0 - middle::traits::select::SelectionContext<'cx, 'tcx>::confirm_candidate::h73c92f23e4b19127mZY
8: 0x7f7bad6ac800 - middle::traits::select::SelectionContext<'cx, 'tcx>::select::h1f6b87c67ed6992dTyX
9: 0x7f7bad6a6360 - middle::traits::fulfill::FulfillmentContext<'tcx>::select::h1c32dca2315fb0adjYW
10: 0x7f7bad5261b0 - middle::traits::fulfill::FulfillmentContext<'tcx>::select_all_or_error::hfb69502c35931f954UW
11: 0x7f7bae5eec70 - check::vtable::select_all_fcx_obligations_or_error::ha9d04af899db1229Ceb
12: 0x7f7bae6c6430 - check::check_bare_fn::h3e6a0e77e248363agck
13: 0x7f7bae6bdfc0 - check::check_item::h2b10ccbb63916a23Gvk
14: 0x7f7bae915d50 - check_crate::unboxed_closure.42746
15: 0x7f7bae910a60 - check_crate::h0d4db076e0bb3313fZy
16: 0x7f7baf88a8b0 - driver::phase_3_run_analysis_passes::h86f5117df0f02e2eEta
17: 0x7f7baf86dc50 - driver::compile_input::h024b52963d907b7crba
18: 0x7f7bafa21c90 - run_compiler::h028a909c6b8b5e8fAYb
19: 0x7f7bafa188d0 - thunk::F.Invoke<A, R>::invoke::h18183104788496625744
20: 0x7f7baf40f010 - thunk::F.Invoke<A, R>::invoke::h2541757334713289964
21: 0x7f7baf078f00 - task::Task::spawn_thunk::closure.5783
22: 0x7f7baf0d7a70 - rust_try_inner
23: 0x7f7baf0d7a60 - rust_try
24: 0x7f7baf079010 - unwind::try::h558067038ea79d14rCc
25: 0x7f7baf078da0 - task::Task::run::h0a756e41b4d98f97sNb
26: 0x7f7baf078510 - thunk::F.Invoke<A, R>::invoke::h14009063998732615525
27: 0x7f7baf079e60 - thread::thread_start::h3654652a3d324e1eM4b
28: 0x7f7ba9bd30c0 - start_thread
29: 0x7f7baed3dec9 - __clone
30: 0x0 - <unknown>

With rust version:

rustc 0.13.0-nightly (42deaa5e4 2014-12-16 17:51:23 +0000)
binary: rustc
commit-hash: 42deaa5e42c0b8a9e305aa5de5d6953b24b77aca
commit-date: 2014-12-16 17:51:23 +0000
host: x86_64-unknown-linux-gnu
release: 0.13.0-nightly

This might be a duplicate of #18623 , but I'm not positive.

Issue 2:
The simplified code below results in an ICE using the following rust version

rustc 1.0.0-beta (9854143 2015-04-02) (built 2015-04-02)

binary: rustc

commit-hash: 9854143

commit-date: 2015-04-02

build-date: 2015-04-02

host: x86_64-apple-darwin

release: 1.0.0-beta

---- CODE resulting in ICE -------

use std::f64;
use std::fs::File;
use std::io::{BufRead, BufReader};

#[derive(Default)]
struct Output {
count: i64,
min: f64,
max: f64,
var: f64,
qk: f64, // helper variables for
mk: f64, // variance calculation
}

fn main() {
let file = File::open("data_random_small.txt");
let buf = BufReader::new(file.unwrap());
let out = compute_statistics(buf);
}

// compute_statistics computes basic statistics for the content of the
// provided BufReader
fn compute_statistics(buf: BufReader<File>) -> Output {
let mut out = Output { count: 0, min: f64::MAX, max: -f64::MAX, var: 0.0,
qk: 0.0, mk: 0.0};
for line_r in buf.lines() {
let line = line_r.unwrap();
let n_r = line.to_string().parse::<f64>();
let n = n_r.unwrap();

// update variance
let k: f64 = out.count as f64;
out.qk += (k - 1.0) * (n - out.mk) * (n - out.mk) / k;
out.mk += (n - out.mk) / k;

out.count += 1;
}
let k: f64 = out.count as f64;
out.var = out.qk / (k-1);
out
}

The issue appears to be the second to last line. The compiler should reject (k-1). Changing this to

out.var = out.qk / (k-1.0);

results in proper compilation. Also, removing the previous scope of the for loop works and the compiler then properly complains about the (k-1) bit. Below is the backtrace:

----- BACKTRACE ----

error: internal compiler error: Impl DefId { krate: 2, node: 39365 } was matchable against Obligation(predicate=Binder(TraitPredicate(core::ops::Sub<_>)),depth=1) but now is not
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 'Box<Any>', /Users/rustbuild/src/rust-buildbot/slave/beta-dist-rustc-mac/build/src/libsyntax/diagnostic.rs:190

stack backtrace:
1: 0x107943f77 - sys::backtrace::write::h799ab135045ca9ca1LC
2: 0x107971e4d - panicking::on_panic::h9502e488a92fc8bcHAI
3: 0x1078962de - rt::unwind::begin_unwind_inner::hf0537788ee16eadbiiI
4: 0x1070755ae - rt::unwind::begin_unwind::h447731439410619827
5: 0x107075df9 - diagnostic::Handler::bug::hb6bac6e14e70580aZsB
6: 0x104b9c3be - middle::traits::select::SelectionContext<'cx, 'tcx>::rematch_impl::h00902254f92fe252QxT
7: 0x104b9bd08 - middle::infer::InferCtxt<'a, 'tcx>::commit_if_ok::h14474907185931287891
8: 0x104b7ce94 - middle::traits::select::SelectionContext<'cx, 'tcx>::confirm_candidate::h3f1d070f70ab815cMPS
9: 0x104b509c6 - middle::traits::select::SelectionContext<'cx, 'tcx>::select::hc528f249f6251cb8OQQ
10: 0x104b6098a - middle::traits::project::project_type::h7ca468ea33bc79f1AwP
11: 0x104b5e367 - middle::traits::project::opt_normalize_projection_type::h766518f8b1310230cpP
12: 0x104b57d86 - middle::traits::project::poly_project_and_unify_type::closure.83535
13: 0x104b55bc0 - middle::traits::project::poly_project_and_unify_type::h44012951a95c13e5l5O
14: 0x104b4d206 - middle::traits::fulfill::FulfillmentContext<'tcx>::select::h7d8cf023413c2180uHO
15: 0x104b4c848 - middle::traits::fulfill::FulfillmentContext<'tcx>::select_where_possible::h0397a49aa695a23cIGO
16: 0x103efa433 - check::vtable::select_fcx_obligations_where_possible::h99330aa4e9f6a658d4b
17: 0x103f3448d - check::FnCtxt<'a, 'tcx>::resolve_type_vars_if_possible::h7c8e59ec20a8f3b2qYo
18: 0x103fb0a3e - check::op::check_binop::h7e7f29a781258fb2u5m
19: 0x10400878d - check::check_expr_with_unifier::h13696137427352880546
20: 0x103ff552c - check::check_expr_with_unifier::h7970691808293538245
21: 0x103fb0a33 - check::op::check_binop::h7e7f29a781258fb2u5m
22: 0x103ff43c3 - check::check_expr_with_unifier::h7970691808293538245
23: 0x10400fab9 - check::check_expr_with_unifier::h6698900367440735538
24: 0x103fbe705 - check::check_block_with_expected::h60bff5b1f9d55793fps
25: 0x103f9ae05 - check::check_fn::h410d0ffafb47f675l1n
26: 0x103fb932e - check::check_bare_fn::h05c77be534ada2cfUQn
27: 0x103fb2ee2 - check::check_item::h9d89bedf29e4fe82F9n
28: 0x10408f676 - check_crate::closure.36302
29: 0x104089ae7 - check_crate::h09aa7856a322fd44bwC
30: 0x103da9355 - driver::phase_3_run_analysis_passes::h1af60e7c926ca39dgGa
31: 0x103d8da85 - driver::compile_input::h27cf4320fd56e5cbQba
32: 0x103e4ba15 - run_compiler::h93c68a2a3c26052bV4b
33: 0x103e491e2 - boxed::F.FnBox<A>::call_box::h4498816167135712709
34: 0x103e486d7 - rt::unwind::try::try_fn::h2387014819904265058
35: 0x1079fbea8 - rust_try_inner
36: 0x1079fbe95 - rust_try
37: 0x103e489ca - boxed::F.FnBox<A>::call_box::h4850138824497903476
38: 0x10795b37d - sys::thread::create::thread_start::h42d6d904fce5365aihH
39: 0x7fff82bc6267 - _pthread_body
40: 0x7fff82bc61e4 - _pthread_start