Skip to content

LLVM errors in MIR trans for struct and tuple ConstVals. #30772

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
solson opened this issue Jan 7, 2016 · 0 comments
Closed

LLVM errors in MIR trans for struct and tuple ConstVals. #30772

solson opened this issue Jan 7, 2016 · 0 comments

Comments

@solson
Copy link
Member

solson commented Jan 7, 2016

These LLVM errors show up when compiling the following test cases with #[rustc_mir].

struct Point {
    _x: i32,
    _y: i32,
}

const STRUCT: Point = Point { _x: 42, _y: 42 };
let _struct = STRUCT;

// MIR: var0 = const expr Point{_x: 42, _y: 42,};

// Output:
// Stored value type does not match pointer operand type!
//   store { i32, i32 } { i32 42, i32 42 }, i64* %0, align 4
//  i64LLVM ERROR: Broken function found, compilation aborted!
const TUPLE: (i32, i32) = (42, 42);
let _tuple = TUPLE;

// MIR: var0 = const expr (42, 42);

// Output:
// Stored value type does not match pointer operand type!
//   store { i32, i32 } { i32 42, i32 42 }, i64* %0, align 4
//  i64LLVM ERROR: Broken function found, compilation aborted!
const TUPLE: (&'static str,) = ("ow",);
let _tuple = TUPLE;

// MIR: var0 = const expr ("ow",);

// Output:
// Invalid bitcast
// i8 addrspace(5)* bitcast ({ %str_slice } { %str_slice { i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str2753, i32 0, i32 0), i64 2 } } to i8 addrspace(5)*)
// LLVM ERROR: Broken function found, compilation aborted!
nagisa added a commit to nagisa/rust that referenced this issue Jan 7, 2016
bors added a commit that referenced this issue Jan 8, 2016
Fixes #30772

We used to have a untested special case which didn’t really work anyway, because of lacking casts. This PR removes the case in question.
nagisa added a commit to nagisa/rust that referenced this issue Jan 9, 2016
…elb1

Fixes rust-lang#30772

We used to have a untested special case which didn’t really work anyway, because of lacking casts. This PR removes the case in question.
nagisa added a commit to nagisa/rust that referenced this issue Jan 11, 2016
…elb1

Fixes rust-lang#30772

We used to have a untested special case which didn’t really work anyway, because of lacking casts. This PR removes the case in question.
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

1 participant