Skip to content

LLVM error with struct with a zero-sized associated type #26127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
arielb1 opened this issue Jun 9, 2015 · 0 comments
Closed

LLVM error with struct with a zero-sized associated type #26127

arielb1 opened this issue Jun 9, 2015 · 0 comments
Assignees

Comments

@arielb1
Copy link
Contributor

arielb1 commented Jun 9, 2015

trait Tr { type T; } impl Tr for u8 { type T=(); }
struct S<I: Tr>(I::T);

fn foo<I: Tr>(i: I::T) {
    S::<I>(i);
}

fn main() {
    foo::<u8>(());
}

LLVM error:

Call parameter type does not match function signature!
%"S<u8>" undef
 %"S<u8>"*  call void @"_ZN11S$LT$u8$GT$8drop.78617h8596c9a8a6407b21E"(%"S<u8>" undef)
LLVM ERROR: Broken function found, compilation aborted!
playpen: application terminated with error code 1

The problem seems to be that some part of LLVM does not like the C_undef we generate for zero-sized types. cc @dotdash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants