Timo
Timo
There's been some discussion for what this should look like in #11808. > arithmetic wrapping (or maybe it should be caught too somehow?) [`arithmetic_side_effects`](https://rust-lang.github.io/rust-clippy/master/index.html#/arithmetic_side_effects) should do this
They are semantically different if the expression has side effects. `async { some_function().await }` only executes the function call on the first poll, whereas `some_function()` eagerly calls the function. `ready`...
Why does `layout_of` (supposedly?) ice when normalization fails anyway? `LayoutError` has a `NormalizationFailure` variant and it seems to be [handling the case](https://github.com/rust-lang/rust/blob/42198bf562b548015e3eae3926c175c4aabb3a7b/compiler/rustc_ty_utils/src/layout.rs#L47) where normalization fails? Or am I missing something/is...
> I tried testing both together with a .fixed file, but that won't work with two lints in opposite directions. The situation is unusual, and in case it is preferred...
I think for this we should be able to use [`PossibleBorrowerMap`](https://doc.rust-lang.org/stable/nightly-rustc/clippy_utils/mir/struct.PossibleBorrowerMap.html). That can tell us that `first` borrows from `name` and we can safely bail out if so. I've been...
There are no try blocks in the reproducer, but I assume what you meant is something like ```rs fn returns_option() -> Option { let _: Option = try { let...
This lint already exists ([question_mark](https://rust-lang.github.io/rust-clippy/master/index.html#/question_mark)), but it only seems to emit a warning for `else { return None };` (note the lack of a semicolon for the return), so this...
This issue seems to be fixed. None of the reproducers mentioned here get linted anymore it looks like: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=3c4b7032d2e1c46d488b42a1a5cc4627
This was implemented in #12077 Output for the example ``` warning: assigning the result of `Clone::clone()` may be inefficient --> src/main.rs:5:5 | 5 | a = b.clone(); | ^^^^^^^^^^^^^ help:...