You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Encountered doing ill-advised type manipulations in the playground. By (mis)using some combination of universal function call syntax, the Fn trait, and other language features, I got an internal compiler error. I then simplified it to the point where it wouldn't make sense even if it didn't hit the error.
Code to reproduce the error:
trait CallSingle<A, B> {
fn call(&self, a: A) -> B where Self: Fn(A) -> B;
}
impl<A, B, F: Fn(A) -> B> CallSingle<A, B> for F {
fn call(&self, a: A) -> B {
<Self as Fn(A) -> B>::call
}
}
I'm not sure there should be any error it emits beyond what it already does, but this does panic the compiler: error: internal compiler error: /checkout/src/librustc_typeck/check/mod.rs:4419: impossible case reached
The text was updated successfully, but these errors were encountered:
#![feature(fn_traits)]traitCallSingle<A,B>{fncall(&self,a:A) -> BwhereSelf:Fn(A) -> B;}impl<A,B,F:Fn(A) -> B>CallSingle<A,B>forF{fncall(&self,a:A) -> B{
<SelfasFn(A) -> B>::call(self,(a,))}}fnmain(){}
---
Compiling playground v0.0.1(file:///playground)
error[E0229]: associated type bindings are not allowed here
--> src/main.rs:9:27
|
9 | <SelfasFn(A) -> B>::call(self,(a,))
| ^ associated type not allowed here
error: aborting due to previous error
I'm closing this because the ICE is fixed and supporting type bindings in value paths (let x = Trait<AssocTy = u8>::method();) is a separate problem, please open a new lang-team issue if you are interested in supporting it.
Encountered doing ill-advised type manipulations in the playground. By (mis)using some combination of universal function call syntax, the Fn trait, and other language features, I got an internal compiler error. I then simplified it to the point where it wouldn't make sense even if it didn't hit the error.
Code to reproduce the error:
I'm not sure there should be any error it emits beyond what it already does, but this does panic the compiler:
error: internal compiler error: /checkout/src/librustc_typeck/check/mod.rs:4419: impossible case reached
The text was updated successfully, but these errors were encountered: