Closed
Description
Testcase:
fn main() {
unsafe {
static BLOCK_UNSAFE_SAFE_PTR: &'static int = &*(0xdeadbeef as *int);
}
}
Output:
rustc: /build/rust-git/src/rust/src/llvm/include/llvm/Support/Casting.h:237: typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X = llvm::GlobalVariable; Y = llvm::Value; typename llvm::cast_retty<X, Y*>::ret_type = llvm::GlobalVariable*]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
fish: Job 1, “rustc bug_generic_static_function_ptr.rs ” terminated by signal SIGABRT (Abort)
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
Twisol commentedon Jan 4, 2015
/cc @eddyb
steveklabnik commentedon Jan 16, 2015
Triage:
emberian commentedon Jan 20, 2015
Confirm.
JustAPerson commentedon Mar 29, 2015
tl;dr: this bug still reproduces
Updated for current Rust (on playpen as of today, 29 March 2015):
This still fails the llvm assertion that @steveklabnik mentioned.
tamird commentedon Apr 21, 2015
I am no longer able to reproduce this on
rustc 1.0.0-dev (f46c4e158 2015-04-20) (built 2015-04-20)
jooert commentedon May 11, 2015
This still fails (when LLVM assertions are enabled) with
[-]LLVM abort while trying to take address of raw pointer in static[/-][+]LLVM assert abort while trying to take address of raw pointer in static[/+]pmarcelll commentedon Jun 19, 2015
This fails with a regular build error on the latest nightly:
alexcrichton commentedon Jun 19, 2015
Agreed!
emberian commentedon Jun 19, 2015
@alexcrichton is there a test for this? I didn't notice one.
alexcrichton commentedon Jun 19, 2015
Probably not specifically, but PRs which often fix issues like this tend to have their own test cases anyway.
Rollup merge of rust-lang#52527 - ljedrz:cleanup_13973, r=oli-obk
Rollup merge of rust-lang#52527 - ljedrz:cleanup_13973, r=oli-obk
Auto merge of rust-lang#13973 - lnicola:replace-arith, r=lnicola