-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-GATsArea: Generic associated types (GATs)Area: Generic associated types (GATs)A-codegenArea: Code generationArea: Code generationC-bugCategory: This is a bug.Category: This is a bug.F-generic_associated_types`#![feature(generic_associated_types)]` a.k.a. GATs`#![feature(generic_associated_types)]` a.k.a. GATsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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.
schneiderfelipe
Metadata
Metadata
Assignees
Labels
A-GATsArea: Generic associated types (GATs)Area: Generic associated types (GATs)A-codegenArea: Code generationArea: Code generationC-bugCategory: This is a bug.Category: This is a bug.F-generic_associated_types`#![feature(generic_associated_types)]` a.k.a. GATs`#![feature(generic_associated_types)]` a.k.a. GATsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.