Closed
Description
I know GAT's are far from complete, but I've played around with them for a bit, and found some fun ICE's and LLVM errors.
The following code produces wrong LLVM output:
#![feature(generic_associated_types)]
trait Fun {
type F<'a>: Fn() -> u32;
fn callme<'a>(f: Self::F<'a>) -> u32 {
f()
}
}
impl <T> Fun for T {
type F<'a> = Self;
}
fn main() {
<fn() -> usize>::callme(|| {1});
}
It produces
Function return type does not match operand type of return inst!
ret i64 %4, !dbg !155
i32in function _ZN10playground3Fun6callme17h68e94299655f2c3eE
LLVM ERROR: Broken function found, compilation aborted!
error: could not compile `playground`.
To learn more, run the command again with --verbose.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment