Closed
Description
While trying to figure out how to properly implement FnMut
for this struct I ran into this ICE. I still don't know how to properly implement it, chances are I was doing it wrong, but I imagine that an ICE isn't expected in any case so I decided to post this up in case it hasn't been brought up.
#![feature(unboxed_closures)]
struct VecEnv<'a> {
vec: Vec<i32>,
}
impl<'a> FnMut(&mut i32, &i32) -> i32 for VecEnv<'a> {
extern "rust-call" fn call_mut(&mut self, (output, text): (&mut i32, &i32)) -> i32 {
println!("CLOSURE");
1i32
}
}
fn main() {}
error: internal compiler error: unexpected panic
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
thread 'rustc' panicked at 'assertion failed: !generic_bounds.has_escaping_regions()', /build/rust-git/src/rust/src/librustc_typeck/check/mod.rs:1784
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
tamird commentedon Apr 21, 2015
No longer gets that far:
@blaenk can you update this?
apasel422 commentedon Oct 24, 2015
I'm not sure if this can really be reproduced today. I got the following to compile:
arielb1 commentedon Oct 24, 2015
@apasel422
They used the "impl Fn(i32) -> i32 for XYZ" syntax.
arielb1 commentedon Oct 24, 2015
duplicate of #24682 + #26638.