-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-type-systemArea: Type systemArea: Type systemE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Description
#![feature(unboxed_closures)]
use std::ops::Fn;
struct Foo(u32);
impl Fn(u32) -> Foo for fn(u32) -> Foo {
extern "rust-call" fn call(&self, args: (u32,)) -> Foo { let (u,) = args; self(u) }
}
fn main() {
let x = Foo.call((42,));
println!("{}", x);
}
<anon>:7:1: 9:2 error: internal compiler error: coherence failed to report ambiguity: cannot locate the impl of the trait `core::ops::Fn(u32) -> Foo` for the type `fn(u32) -> Foo`
<anon>:7 impl Fn(u32) -> Foo for fn(u32) -> Foo {
<anon>:8 extern "rust-call" fn call(&self, args: (u32,)) -> Foo { let (u,) = args; self(u) }
<anon>:9 }
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 'Box<Any>', /build/rust-git/src/rust/src/libsyntax/diagnostic.rs:123
Metadata
Metadata
Assignees
Labels
A-type-systemArea: Type systemArea: Type systemE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️