Skip to content
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

Borrowing a mutable explicit self pointer as immutable trips an LLVM assert #3357

Closed
pcwalton opened this issue Sep 2, 2012 · 1 comment
Closed
Labels
A-lifetimes Area: Lifetimes / regions I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

Comments

@pcwalton
Copy link
Contributor

pcwalton commented Sep 2, 2012

Test case:

struct Foo {
    x: int;
}

impl Foo {
    fn f(&self) {}
}

fn g(x: &mut Foo) {
    x.f();
}

fn main() {
}

Error:

rustc: /home/pcwalton/Source/rust/src/llvm/lib/VMCore/Instructions.cpp:1062: void llvm::StoreInst::AssertOK(): Assertion `getOperand(0)->getType() == cast<PointerType>(getOperand(1)->getType())->getElementType() && "Ptr must be a pointer to Val type!"' failed.

@nikomatsakis, any ideas?

@pcwalton
Copy link
Contributor Author

pcwalton commented Sep 2, 2012

The problem is in adapt_borrowed_value. I think I may have a hunch as to what's wrong.

RalfJung pushed a commit to RalfJung/rust that referenced this issue Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lifetimes Area: Lifetimes / regions I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Projects
None yet
Development

No branches or pull requests

1 participant