-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Compiler crashes with "Calling a function with a bad signature" #9382
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
Comments
I'm not sure if this is the same underlying bug or not, but you can get the same "Calling a function with a bad signature" compiler crash with this code: struct A<'self> {
a: &'self [~int],
b: ~[int]
}
fn main() {
let _a = A{
a:[],
b:~[]
};
} If you remove either of the two fields it works fine. If you move the value of _a.b into its own local variable it works fine, but moving just the value of _a.a into its own local var does not help. The types of the array elements ( This bug is easy to trigger when trying to create a |
Nominating for 1.0, looks like this affects anything which wants to return |
I want to try and have a stab at this now :) |
I just spent the last couple minutes reducing a bug down to @MicahChalmer's example :) The little bit extra I can add is that this code compiles fine:
Also, the assertion is happening in the |
Another variation that does not work. We trip over this bug when auto-coercing a
However, if we use
So we have work arounds for anyone that runs into this bug. |
cc |
cc me |
I don't know if this is completely fixed, but as of today (ad58e2c) the program in the original post compiles successfully. |
So this seems to be triggered when we auto-slice a vec and the cleanups happen in a landing pad. Here's a working case: https://gist.github.com/luqmana/47be9ac078b542a50051 Both use the same struct except for a small change. For the working case the second field is a In the broken case, it seems to try to allocate the |
Like a ninja, @luqmana is awesome. |
The following code crashes the compiler
The crash does not occur if "&A" is replaced by "@A" or "~A".
The text was updated successfully, but these errors were encountered: