-
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
consider bannig empty panic
/unreachable
/ bug
s from rustc codebase
#118955
Comments
13 of the That leaves 24 unlabeled panics, as far as I can tell:
|
I'll take a stab at annotating some of the ones in |
Assuming the currently outstanding PRs are accepted, the remaining unlabeled I have not even glanced at where all the |
Annotate some bugs Gives a semi-helpful message to some `bug!()`/`unreachable!()`/`panic!()`. This also works around some other bugs/panics/etc that weren't needed, and also makes some of them into `span_bug!`s so they also have a useful span. Note to reviewer: best to disable whitespace when comparing for some cases where indentation changed. cc rust-lang#118955
…m-abi, r=davidtwco Annotate panic! reasons during enum layout Add some reasons to the panics, and use more exhaustive matches. Also see: rust-lang#118955
Rollup merge of rust-lang#118974 - workingjubilee:why-worry-about-enum-abi, r=davidtwco Annotate panic! reasons during enum layout Add some reasons to the panics, and use more exhaustive matches. Also see: rust-lang#118955
Rollup merge of rust-lang#118962 - compiler-errors:bugs, r=TaKO8Ki Annotate some bugs Gives a semi-helpful message to some `bug!()`/`unreachable!()`/`panic!()`. This also works around some other bugs/panics/etc that weren't needed, and also makes some of them into `span_bug!`s so they also have a useful span. Note to reviewer: best to disable whitespace when comparing for some cases where indentation changed. cc rust-lang#118955
Add better ICE messages for some undescriptive panics Add some better messages at some panics re: rust-lang#118955 I took a look at some others but either was not able to figure out what they did, or it was unclear what they should say instead. For example in the query system whether each time a poisoned value is matched upon if they should all just call `FatalError.raise()`
Rollup merge of rust-lang#118967 - RossSmyth:panic-messages, r=TaKO8Ki Add better ICE messages for some undescriptive panics Add some better messages at some panics re: rust-lang#118955 I took a look at some others but either was not able to figure out what they did, or it was unclear what they should say instead. For example in the query system whether each time a poisoned value is matched upon if they should all just call `FatalError.raise()`
would it be worth it to add an internal lint for this? |
Query panic!() to useful diagnostic Changes some more ICEs from bare panic!()s Adds an `expect_job()` helper method as that is a moral equivalent of what was happening at the uses. re:rust-lang#118955
…-errors Query panic!() to useful diagnostic Changes some more ICEs from bare panic!()s Adds an `expect_job()` helper method as that is a moral equivalent of what was happening at the uses. re:rust-lang#118955
Rollup merge of rust-lang#119086 - RossSmyth:query_panics, r=compiler-errors Query panic!() to useful diagnostic Changes some more ICEs from bare panic!()s Adds an `expect_job()` helper method as that is a moral equivalent of what was happening at the uses. re:rust-lang#118955
Update (2024-02-27):
|
I wonder if it makes sense to try to fill these up with at least somewhat contextual error/ice messages instead of just a "panicked at" or "impossible case reached"?
Unfortunately I could not find a rustc lint that warns on empty panics like these
The text was updated successfully, but these errors were encountered: