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

LLVM assertion failed when passing a Option<extern "C" fn()> to an extern "C" fn #9692

Closed
brendanzab opened this issue Oct 3, 2013 · 3 comments
Labels
A-FFI Area: Foreign function interface (FFI) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@brendanzab
Copy link
Member

extern "C" fn glfwSetErrorCallback(_: Option<extern "C" fn()>) {}

extern "C" fn error_callback() {}

#[fixed_stack_segment]
#[inline(never)]
fn main() {
    glfwSetErrorCallback(Some(error_callback));
}
rustc test.rs
Assertion failed: (getOperand(0)->getType() == cast<PointerType>(getOperand(1)->getType())->getElementType() && "Ptr must be a pointer to Val type!"), function AssertOK, file /Users/brendan/dev/rust/rust/src/llvm/lib/IR/Instructions.cpp, line 1084.
zsh: abort      rustc test.rs

gdb output

cc. @nikomatsakis

@jeaye
Copy link

jeaye commented Oct 3, 2013

I'm also getting this on Arch x64 with the latest nightly rustc.

@brendanzab
Copy link
Member Author

Me on OSX, with the latest rustc.

@thestinger
Copy link
Contributor

Fixed by f504461.

flip1995 pushed a commit to flip1995/rust that referenced this issue Nov 21, 2022
make ignored internally mutable types for `mutable-key` configurable

We had some false positives where people would create their own types that had interior mutability unrelated to hash/eq. This addition lets you configure this as e.g. `arc-like-types=["bytes::Bytes"]`

This fixes rust-lang#5325 by allowing users to specify the types whose innards like `Arc` should be ignored (the generic types are still checked) for the sake of detecting inner mutability.

r? `@Alexendoo`

---

changelog: Allow configuring types to ignore internal mutability in `mutable-key`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-FFI Area: Foreign function interface (FFI) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

3 participants