Issue 1:
use std::num::Float;

struct Point {x: f64, y: f64}

fn compute_distance(p1: &Point, p2: &Point) -> f64 {
let x_d = p1.x - p2.x;
let y_d = p1.y - p2.y;
Float::sqrt(x_d * x_d + y_d * y_d)
}

fn main() {
let on_the_stack : Point = Point {x: 3.0, y: 4.0};
let on_the_heap : Box<Point> = box Point {x: 7.0, y: 9.0};

compute_distance(&on_the_stack, &*on_the_heap);
}

sun@sun:~/Desktop/Rust$ RUST_BACKTRACE=1 rustc reference_lifetime.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 'assertion failed: `(left == right) && (right == left)` (left: `3`, right: `0`)', /home/sun/rust/src/librustc/middle/trans/callee.rs:528

stack backtrace:
1: 0xb61f3c80 - rt::backtrace::imp::write::h8e87d0f1c0e6314eOcq
2: 0xb61f6b80 - failure::on_fail::hd69e89a09fe1c193byq
3: 0xb656edd0 - unwind::begin_unwind_inner::h8024dabe9217e622Axd
4: 0xb656e9f0 - unwind::begin_unwind_fmt::he2b10618cd8e2a3b2ud
5: 0xb6af3910 - middle::trans::callee::trans_fn_ref_with_substs::h35ded8d4791617efGC3
6: 0xb6af17a0 - middle::trans::callee::trans_fn_ref::h6fb7a7f230364cc9wq3
7: 0xb6afa3d0 - middle::trans::callee::trans_call::closure.122313
8: 0xb6ad10f0 - middle::trans::callee::trans_call_inner::hb58abead86d536f4qY3
9: 0xb6afa140 - middle::trans::callee::trans_call::h1afd80801dd261bfKS3
10: 0xb6b09d60 - middle::trans::expr::trans_rvalue_dps_unadjusted::hd623d2ee101663f1365
11: 0xb6ac8780 - middle::trans::expr::trans_into::hfbee30f25eca9fb7BI4
12: 0xb6ac8bf0 - middle::trans::controlflow::trans_block::h1bd514ecdbd0e95bRY0
13: 0xb6b77750 - middle::trans::base::trans_closure::h6be5203281e95063V4g
14: 0xb6aba540 - middle::trans::base::trans_fn::hfdfc7543375f42e2jgh
15: 0xb6ab7540 - middle::trans::base::trans_item::h4c0dbd6cae5d4359Czh
16: 0xb6b82ac0 - middle::trans::base::trans_crate::h5d3949c27f22bd3dtxi
17: 0xb6ff9dc0 - driver::driver::phase_4_translate_to_llvm::h2473848275bafe8d6yA
18: 0xb6ff1030 - driver::driver::compile_input::hcf3ef773b2081d8f05z
19: 0xb707bc80 - driver::run_compiler::hf7e21306399a9813bTD
20: 0xb707bb30 - driver::run::closure.144861
21: 0xb6745ee0 - task::TaskBuilder<S>::try_future::closure.103260
22: 0xb6745cc0 - task::TaskBuilder<S>::spawn_internal::closure.103231
23: 0xb76d81b0 - task::NativeSpawner.Spawner::spawn::closure.8437
24: 0xb656e790 - unwind::try::try_fn::h9de4ea0e925684b3tod
25: 0xb65d7700 - rust_try_inner
26: 0xb65d76c0 - rust_try
27: 0xb656c770 - unwind::try::h30a13c8b3633dc23imd
28: 0xb656c5e0 - task::Task::run::hd3b288cf5211df4eWBc
29: 0xb76d7f30 - task::NativeSpawner.Spawner::spawn::closure.8377
30: 0xb656de90 - thread::thread_start::h22611edb92a890cf7Vc
31: 0xb60c9e40 - start_thread
32: 0xb64649f2 - clone
33: 0x0 - <unknown>

Version

sun@sun:~/Desktop/Rust$ rustc -v
rustc 0.13.0-dev (96991e933 2014-10-22 23:57:11 +0000)

System

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.10
Release: 14.10
Codename: utopic

Issue 2:
STR

// seq.rs
use std::collections::HashMap;
use std::hash::Hash;

pub trait Seq<T> {
#[cfg(ice)]
fn add_elem(&mut self, T);

#[cfg(not(ice))]
fn add_elem(&mut Self, T);

fn new() -> Self;
}

impl<K, V> Seq<(K, V)> for HashMap<K, V> where K: Eq + Hash {
#[cfg(ice)]
fn add_elem(&mut self, (key, value): (K, V)) {
self.insert(key, value);
}

#[cfg(not(ice))]
fn add_elem(m: &mut HashMap<K, V>, (key, value): (K, V)) {
m.insert(key, value);
}

fn new() -> HashMap<K, V> {
HashMap::new()
}
}

// app.rs
extern crate seq;

use std::collections::HashMap;

fn main() {
let _: HashMap<char, String> = {
let mut temp = ::seq::Seq::new();

::seq::Seq::add_elem(&mut temp, ('a', "apple".to_string()));

temp
};
}

$ rustc --cfg ice --crate-type=lib seq.rs
$ rustc -L . app.rs

If you omit the --cfg ice flag, compiling app.rs doesn't ICE. In that case UFCS is not used at all.

Backtrace

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 'assertion failed: `(left == right) && (right == left)` (left: `11`, right: `0`)', /var/tmp/paludis/build/dev-lang-rust-scm/work/rust-scm/src/librustc/middle/trans/callee.rs:504

stack backtrace:
1: 0x7f8c4420a530 - rt::backtrace::imp::write::hc0bea45eeb94b4f2gDq
2: 0x7f8c4420d660 - <unknown>
3: 0x7f8c449ac890 - unwind::begin_unwind_inner::h7a44b117581e2f74Gxd
4: 0x7f8c449ac3d0 - unwind::begin_unwind_fmt::h45039a117ffe43968ud
5: 0x7f8c4518e740 - middle::trans::callee::trans_fn_ref_with_substs::h5c6fbb3c911b1c9bsm2
6: 0x7f8c4518bd60 - middle::trans::callee::trans_fn_ref::h76d352f707b079480a2
7: 0x7f8c45194650 - <unknown>
8: 0x7f8c4516c1b0 - middle::trans::callee::trans_call_inner::h1363a864f6bb88c0aI2
9: 0x7f8c451943a0 - middle::trans::callee::trans_call::hdf5a1e27fb88e0bavC2
10: 0x7f8c451a3530 - <unknown>
11: 0x7f8c45164440 - middle::trans::expr::trans_into::h51830a680129f037ss3
12: 0x7f8c45163830 - middle::trans::controlflow::trans_stmt_semi::h4f58c2f4320d1330KEZ
13: 0x7f8c45162de0 - middle::trans::controlflow::trans_stmt::h46e53ff7f38da11cxAZ
14: 0x7f8c45164860 - middle::trans::controlflow::trans_block::ha4ca6acf3ba4f0c5DFZ
15: 0x7f8c451a3530 - <unknown>
16: 0x7f8c451a2170 - <unknown>
17: 0x7f8c45165990 - middle::trans::expr::trans::h1177439ad486cf5emw3
18: 0x7f8c4520b8f0 - middle::trans::_match::store_local::hde75dbf3d187178beZi
19: 0x7f8c45163a20 - middle::trans::base::init_local::h9df9f875fba43791YJe
20: 0x7f8c45162de0 - middle::trans::controlflow::trans_stmt::h46e53ff7f38da11cxAZ
21: 0x7f8c45164860 - middle::trans::controlflow::trans_block::ha4ca6acf3ba4f0c5DFZ
22: 0x7f8c452150f0 - middle::trans::base::trans_closure::h56e66481b064a22boBf
23: 0x7f8c45156370 - middle::trans::base::trans_fn::hcc6c7d7c981b98c0MMf
24: 0x7f8c451539d0 - middle::trans::base::trans_item::h1fa8cc7bd69d090855f
25: 0x7f8c452206b0 - middle::trans::base::trans_crate::he0691a6f7c0f1264B4g
26: 0x7f8c45671e10 - driver::driver::phase_4_translate_to_llvm::hfb1745881244cd9ayEx
27: 0x7f8c45668110 - driver::driver::compile_input::hc2b446e7823ca44dtbx
28: 0x7f8c456f3980 - <unknown>
29: 0x7f8c456f3830 - <unknown>
30: 0x7f8c44db9d80 - <unknown>
31: 0x7f8c44db9b60 - <unknown>
32: 0x7f8c45f65980 - <unknown>
33: 0x7f8c449fd4b0 - <unknown>
34: 0x7f8c449fd4a0 - rust_try
35: 0x7f8c449aa150 - unwind::try::h18af68ce3545f05domd
36: 0x7f8c449a9fd0 - task::Task::run::he7074020ac841b032Bc
37: 0x7f8c45f656c0 - <unknown>
38: 0x7f8c449ab8a0 - <unknown>
39: 0x7f8c43cd21d0 - start_thread
40: 0x7f8c446851b9 - clone
41: 0x0 - <unknown>

Version

rustc 0.13.0-dev (e4761c85b 2014-10-15 09:57:18 +0000)

cc @nick29581