Skip to content

Compound assignment between boxed types results in LLVM assertion failure #631

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
brson opened this issue Jul 7, 2011 · 2 comments
Closed
Labels
A-type-system Area: Type system E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@brson
Copy link
Contributor

brson commented Jul 7, 2011

The following code

auto x = @10;
x += @20;

fails with "rustc: Instructions.cpp:1567: void llvm::BinaryOperator::init(llvm::Instruction::BinaryOps): Assertion `getType()->isIntOrIntVectorTy() && "Tried to create an integer operation on a non-integer type!"' failed."

This is probably because the typechecking code for binary operations is shared with that for compound assignment statements, but binary operations autoderef while assignment doesn't.

Not sure what is supposed to happen. Maybe this just shouldn't be allowed.

@eholk
Copy link
Contributor

eholk commented Jul 7, 2011

To me this looks like you're trying to do pointer arithmetic, which should not be allowed, in my opinion.

marijnh added a commit that referenced this issue Jul 8, 2011
Closes issue #631

Removes ty::strip_boxes entirely, since unboxing is now more complicated
anyway.
@msullivan
Copy link
Contributor

It looks like this has been closed...

marysaka pushed a commit to sunriseos/rust that referenced this issue Oct 20, 2019
ZuseZ4 pushed a commit to EnzymeAD/rust that referenced this issue Mar 7, 2023
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-type-system Area: Type system E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

3 participants