Closed
Description
On Rust 1.0
#[derive(Debug)]
enum Sexpression {
Id(String),
Num(f64),
Cons(Box<(Sexpression, Sexpression)>)
}
fn mutate_each_float<F>(l: &mut Sexpression, f: &mut F)
where F: FnMut(&mut f64)
{
let mut l = l;
loop { match l {
&mut Sexpression::Id(..) => {},
&mut Sexpression::Num(ref mut n) => f(n),
&mut Sexpression::Cons(ref mut expr) => {
let &mut (ref mut car, ref mut cdr) = &mut **expr;
mutate_each_float(cdr, f);
l = car;
}
}}
}
fn main() {
}
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 'assertion failed: `(left == right)` (left: `TyS { sty: ty_float(f64), flags: 0, region_depth: 0 }`, right: `TyS { sty: ty_uniq(TyS { sty: ty_tup([TyS { sty: ty_enum(DefId { krate: 0, node: 4 }, Substs { types: VecPerParamSpace {TypeSpace: [], SelfSpace: [], FnSpace: [], }, regions: NonerasedRegions(VecPerParamSpace {TypeSpace: [], SelfSpace: [], FnSpace: [], }) }), flags: 0, region_depth: 0 }, TyS { sty: ty_enum(DefId { krate: 0, node: 4 }, Substs { types: VecPerParamSpace {TypeSpace: [], SelfSpace: [], FnSpace: [], }, regions: NonerasedRegions(VecPerParamSpace {TypeSpace: [], SelfSpace: [], FnSpace: [], }) }), flags: 0, region_depth: 0 }]), flags: 0, region_depth: 0 }), flags: 0, region_depth: 0 }`)', /home/rustbuild/src/rust-buildbot/slave/stable-dist-rustc-linux/build/src/librustc_borrowck/borrowck/mod.rs:438