-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Closed
Labels
A-edition-2021Area: The 2021 editionArea: The 2021 editionC-bugCategory: This is a bug.Category: This is a bug.
Description
I tried this code:
fn f() {
assert!(true, 123);
}I expected to see this happen: This includes a machine-applicable fix to migrate to 2021.
Instead, this happened: The suggestion is MaybeIncorrect preventing automatic migration.
Part of the problem is that there isn't an easy way to convert this to panic_any. For example, it could convert to:
fn f() {
if !(expr) { ::std::panic::panic_any(123); }
}which is pretty awful and probably has other downsides. Trying to format with {:?} is also probably not a reliable option, since it would require the payload to impl Debug, and the user's code may be relying on catching the panic and inspecting the payload.
I don't know what is really practical here.
Meta
rustc 1.55.0-nightly (014026d1a 2021-07-19)
Metadata
Metadata
Assignees
Labels
A-edition-2021Area: The 2021 editionArea: The 2021 editionC-bugCategory: This is a bug.Category: This is a bug.