-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Nightly regression: panic::set_hook()
signature incompatible if used with core::panic::PanicInfo
#126766
Comments
It doesn't even need to be a |
#115974 was merged under the assumption that std crates are unlikely to use |
panic::set_hook()
signature incompatible in the absence of the std preludepanic::set_hook()
signature incompatible if used with core::panic::PanicInfo
Nice catch! |
rust-analyzer has a setting for "prefer |
Closing since regression is mentioned in the release notes |
Code
I tried this code:
playground
I expected to see this happen: It compiles just fine
Instead, this happened: I get the following error:
On nightly
PanicInfo
is a type alias forPanicHookInfo
, however the alias only exists in thestd
crate. If you referencePanicInfo
fromcore
, that is now a different type that does not unify withPanicHookInfo
.It is relatively common in crates that support
no_std
to always use the lowest possible crate to reference for any reexported type, which is why our code was referencingcore::panic
even though this particular snippet of code needsstd
to work overall.Version it worked on
It most recently worked on: Rust 1.79, Rust 1.80-beta3
Version with regression
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: