Skip to content

Ptr must be a pointer to a Val type LLVM error #10674

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
alexjg opened this issue Nov 26, 2013 · 2 comments
Closed

Ptr must be a pointer to a Val type LLVM error #10674

alexjg opened this issue Nov 26, 2013 · 2 comments
Labels
A-codegen Area: Code generation I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@alexjg
Copy link

alexjg commented Nov 26, 2013

I'm using rust 0.8 on Arch Linux 64 bit.

The following program

use std::hashmap::HashMap;

struct SomeStruct<'self> {
    field : ~HashMap<int, &'self Map<int, ~str>>
}

fn main() {
    let mut mapone : HashMap<int, ~str> = HashMap::new();
    mapone.insert(3, ~"somestring");
    let mut maptwo : ~HashMap<int, &Map<int, ~str>> = ~HashMap::new();
    maptwo.insert(3, &mapone as &Map<int, ~str>);
    let val = SomeStruct{
        field: maptwo
    };
    return ();
}

Gives this error on compiling

rustc: /build/rust/src/rust-0.8/src/llvm/lib/IR/Instructions.cpp:1084: void llvm::StoreInst::AssertOK(): Assertion `getOperand(0)->getType() == cast<PointerType>(getOperand(1)->getType())->getElementType() && "Ptr must be a pointer to Val type!"' failed.
[1]    8199 abort (core dumped)  rustc failure.rs

I'm probably doing something wrong as I'm still a rust newbie but the error message isn't very helpful.

@thestinger
Copy link
Contributor

It seems this is fixed on master. You can use the nightly repository for Arch:

[thestinger]
SigLevel = Optional
Server = http://pkgbuild.com/~thestinger/repo/$arch

@alexjg
Copy link
Author

alexjg commented Nov 26, 2013

Briliant, that's solved the problem, cheers.

flip1995 pushed a commit to flip1995/rust that referenced this issue May 20, 2023
Rename `integer_arithmetic`

The lack of official feedback in rust-lang#10200 made me give up on pursuing the matter but after yet another use-case that is not handled by `integer_arithmetic` (rust-lang#10615), I think it is worth trying again.

---

changelog: Move/Deprecation: Rename `integer_arithmetic` to `arithmetic_side_effects`
[rust-lang#10674](rust-lang/rust-clippy#10674)
<!-- changelog_checked -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants