-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Rust compiler unexpected panic on 1.62.0-nightly #96598
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 don't exactly know how much detail I should be giving about the code. If the current snippet is not adequate, I can expose more of it. |
I noticed that the async fn handle(
guest_client: Client,
host_client: &mut Client,
result: ClientListenResult,
host: &mut Member<Self>, // This is wrong, Self = Guest
guest: &mut Member<Guest>
) {}
async fn handle(
guest_client: Client,
host_client: &mut Client,
result: ClientListenResult,
host: &mut Member<Host>, // This is the correct type
guest: &mut Member<Guest>
) {} I also noticed that I skipped the // `host_client` is missing
Guest::handle(guest_client, result, &mut self.host, &mut self.guest).await;
// Fix
Guest::handle(guest_client, &mut host_client, result, &mut self.host, &mut self.guest).await; Currently, the code has two errors. When I fix them, the code compiles straightaway. When I fix only one of them, the compiler shows me the other error, without crashing. But interestingly when I don't fix any of the errors, and leave them as they are, the compiler crashes. |
Hey @brkydnc, is there a way that you could minimize this? The code you provided is missing a ton of types and method signatures. I tried my best to reproduce your issue but I could not because I cannot guess what more than half of these methods should be taking as inputs and outputs. |
Hi @compiler-errors, I'm sorry that I hadn't included a minimized version before your comment. Here is a minimized version of the code that triggers the exact same compiler bug. struct A;
struct B;
struct C;
fn whoops(_: A, _: B, _: A) { }
fn main() {
whoops(B, C);
} I realized that this does not crash the compiler on newer versions, should I close this issue? |
I think this was fixed by #97303, thanks for filing the report and thanks for creating a minimization! |
Code
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: