-
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
Rename ConstPropLint
to KnownPanicsLint
#121286
Conversation
r? @davidtwco rustbot has assigned @davidtwco. Use r? to explicitly pick a reviewer |
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
|
||
// FIXME(oli-obk, eddyb) Optimize locals (or even local paths) to hold |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this comment as it talks about "optimizing" locals while the code does not optimize anything any more. The comment is a relic from the glorious past when it used to be a full-blooded const propagator until it was brutally gutted and turned into a mere lint.
this lint is about detecting code patterns that are known to cause panics at runtime. maybe KnownPanic? KnownRuntimePanic? UnconditionalPanic? |
Adding one more to the mix, Let's hear from others. I'll change it to whatever we all agree on. |
This seems best. We can't prove that a panic is actually unconditional 😅 |
How about just (Note that I'm also suggesting using the plural "Panics" instead of "Panic") |
Or just |
Or |
I think it adds a lot of value. |
Makes sense. Let's go with Will wait for a day. If no one objects, will make the change tomorrow. |
It is a clearer name because it communicates what the lint does instead of the underlying mechanism it uses (const propagation).
6c1ef72
to
42c4df0
Compare
ConstPropLint
to OverflowLint
ConstPropLint
to KnownPanicsLint
Renamed to |
…-obk Rename `ConstPropLint` to `KnownPanicsLint` `OverflowLint` is a clearer name because it communicates what the lint does instead of the underlying mechanism it uses (const propagation) which should be of secondary concern. `OverflowLint` isn't the most accurate name because the lint looks for other errors as well such as division by zero not just overflows, but I couldn't think of another equally succinct name. As a part of this change. I've also added/updated some of the comments. cc `@RalfJung` `@oli-obk` for visibility in case you go looking for the lint using the old name. Edit: Changed the name from `OverflowLint` to `KnownPanicsLint`
Rollup of 8 pull requests Successful merges: - rust-lang#121167 (resolve: Scale back unloading of speculatively loaded crates) - rust-lang#121196 (Always inline check in `assert_unsafe_precondition` with cfg(debug_assertions)) - rust-lang#121206 (Top level error handling) - rust-lang#121223 (intrinsics::simd: add missing functions) - rust-lang#121241 (Implement `NonZero` traits generically.) - rust-lang#121242 (Generate `getelementptr` instead of `inttoptr` for `ptr::invalid`) - rust-lang#121278 (Remove the "codegen" profile from bootstrap) - rust-lang#121286 (Rename `ConstPropLint` to `KnownPanicsLint`) r? `@ghost` `@rustbot` modify labels: rollup
…-obk Rename `ConstPropLint` to `KnownPanicsLint` `OverflowLint` is a clearer name because it communicates what the lint does instead of the underlying mechanism it uses (const propagation) which should be of secondary concern. `OverflowLint` isn't the most accurate name because the lint looks for other errors as well such as division by zero not just overflows, but I couldn't think of another equally succinct name. As a part of this change. I've also added/updated some of the comments. cc ``@RalfJung`` ``@oli-obk`` for visibility in case you go looking for the lint using the old name. Edit: Changed the name from `OverflowLint` to `KnownPanicsLint`
Rollup of 8 pull requests Successful merges: - rust-lang#121167 (resolve: Scale back unloading of speculatively loaded crates) - rust-lang#121196 (Always inline check in `assert_unsafe_precondition` with cfg(debug_assertions)) - rust-lang#121241 (Implement `NonZero` traits generically.) - rust-lang#121278 (Remove the "codegen" profile from bootstrap) - rust-lang#121286 (Rename `ConstPropLint` to `KnownPanicsLint`) - rust-lang#121291 (target: Revert default to the medium code model on LoongArch targets) - rust-lang#121302 (Remove `RefMutL` hack in `proc_macro::bridge`) - rust-lang#121318 (Trigger `unsafe_code` lint on invocations of `global_asm`) Failed merges: - rust-lang#121206 (Top level error handling) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#121286 - gurry:constprop-lint-rename, r=oli-obk Rename `ConstPropLint` to `KnownPanicsLint` `OverflowLint` is a clearer name because it communicates what the lint does instead of the underlying mechanism it uses (const propagation) which should be of secondary concern. `OverflowLint` isn't the most accurate name because the lint looks for other errors as well such as division by zero not just overflows, but I couldn't think of another equally succinct name. As a part of this change. I've also added/updated some of the comments. cc ```@RalfJung``` ```@oli-obk``` for visibility in case you go looking for the lint using the old name. Edit: Changed the name from `OverflowLint` to `KnownPanicsLint`
OverflowLint
is a clearer name because it communicates what the lint does instead of the underlying mechanism it uses (const propagation) which should be of secondary concern.OverflowLint
isn't the most accurate name because the lint looks for other errors as well such as division by zero not just overflows, but I couldn't think of another equally succinct name.As a part of this change. I've also added/updated some of the comments.
cc @RalfJung @oli-obk for visibility in case you go looking for the lint using the old name.
Edit:
Changed the name from
OverflowLint
toKnownPanicsLint