-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Self-referencing closure paniced the compiler #107301
Comments
Update: This panics: trader.set_closure(|trader: Trader| {
trader.print_liquidity();
}); but this doesn't: trader.set_closure(|trader| {
trader.print_liquidity();
}); neither this: trader.set_closure(|trader : &mut Trader| {
trader.print_liquidity();
}); |
This ICEs on the playground (link) on nightly, but not on beta or stable. I did a bisect: searched nightlies: from nightly-2023-01-20 to nightly-2023-01-22 bisected with cargo-bisect-rustc v0.6.5Host triple: x86_64-unknown-linux-gnu cargo bisect-rustc --regress=ice --start=2023-01-20 --end=2023-01-22 The backtrace mentions |
…losure-arg-needs-borrow, r=oli-obk Correct suggestions for closure arguments that need a borrow Fixes rust-lang#107301 by dealing with binders correctly Fixes another issue where we were suggesting adding just `&` when we expected `&mut _` in a closure arg
…losure-arg-needs-borrow, r=oli-obk Correct suggestions for closure arguments that need a borrow Fixes rust-lang#107301 by dealing with binders correctly Fixes another issue where we were suggesting adding just `&` when we expected `&mut _` in a closure arg
"When the compiler of the safest programming language panics, doom shall come upon us"
Jokes aside, this is the snippet (aka "the destroyer of worlds"):
the panic happens when calling "set_closure", even tho there's no body inside that function.
Cargo output:
The text was updated successfully, but these errors were encountered: