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 with overloaded call and trait coercion. #14960

Closed
luqmana opened this issue Jun 17, 2014 · 1 comment
Closed

LLVM assertion with overloaded call and trait coercion. #14960

luqmana opened this issue Jun 17, 2014 · 1 comment
Labels
A-codegen Area: Code generation A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-traits Area: Trait system I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

Comments

@luqmana
Copy link
Member

luqmana commented Jun 17, 2014

Reported by @sfackler

#![feature(overloaded_calls)]

trait Foo {}

struct Bar;

impl<'a> std::ops::Fn<(&'a Foo,), ()> for Bar {
    fn call(&self, _: (&'a Foo,)) {}
}

struct Baz;

impl Foo for Baz {}

fn main() {
    let bar = Bar;
    let baz = &Baz;
    bar(baz);
}
rustc: /scratch/laden/rust/src/llvm/lib/IR/Instructions.cpp:281: void llvm::CallInst::init(llvm::Value*, llvm::ArrayRef<llvm::Value*>, const llvm::Twine&): Assertion `(i >= FTy->getNumParams() || FTy->getParamType(i) == Args[i]->getType()) && "Calling a function with a bad signature!"' failed.
@sfackler
Copy link
Member

Dup of #14958

lnicola pushed a commit to lnicola/rust that referenced this issue Jun 19, 2023
Add span to group.

This appears to fix rust-lang#14959, but I've never contributed to rust-analyzer before and there were some things that confused me:

- I had to add the `fn byte_range` method to get it to build. This was added to rust in [April](rust-lang#109002), so I don't understand why it wasn't needed until now
- When testing, I ran into the fact that rust recently updated its `METADATA_VERSION`, so I had to test this with nightly-2023-05-20. But then I noticed that rust has its own copy of `rust-analyzer`, and the metadata version bump has already been [handled there](rust-lang@60e95e7). So I guess I don't really understand the relationship between the code there and the code here.
bors added a commit to rust-lang-ci/rust that referenced this issue Aug 7, 2023
…-failure, r=Veykril

Don't provide `add_missing_match_arms` assist when upmapping match arm list failed

Fixes rust-lang#15310

We shouldn't provide the assist when we fail to find the original match arm list.

Note that this PR will temporarily make the assist not applicable when attribute macro operates on the match expression in question, just like the case in rust-lang#15310, for most of the current stable toolchain users. This is because the sysroot-abi proc-macro-srv on the current stable [discards] spans for `Group` delimiters in some code paths, which the popular `proc-macro2` crate almost always calls, and it makes the identity of match arm list's brackets lost, leading to the upmapping failure. This has been fixed by rust-lang#14960, which will land in the next stable, 1.71.

[discards]: https://github.com/rust-lang/rust/blob/8ede3aae28fe6e4d52b38157d7bfe0d3bceef225/src/tools/rust-analyzer/crates/proc-macro-srv/src/abis/abi_sysroot/ra_server.rs#L231
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-traits Area: Trait system 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

2 participants