Suppress the triggering of some lints in derived structures
Fixes#10185Fixes#10417
For `integer_arithmetic`, `arithmetic_side_effects` and `shadow_reuse`.
* ~~Not sure how to test these use-cases so feel free to point any method or any related PR.~~
---
changelog: FP: [`integer_arithmetic`], [`arithmetic_side_effects`]: No longer lint inside proc macros
[#10203](https://github.com/rust-lang/rust-clippy/pull/10203)
<!-- changelog_checked -->
Add size-parameter to unecessary_box_returns
Fixes#10641
This adds a configuration-knob to the `unecessary_box_returns`-lint which allows _not_ linting a `fn() -> Box<T>` if `T` is "large". The default byte size above which we no longer lint is 128 bytes (due to https://github.com/rust-lang/rust-clippy/issues/4652#issue-505670554, also used in #9373). The overall rational is given in #10641.
---
changelog: Enhancement: [`unnecessary_box_returns`]: Added new lint configuration `unnecessary-box-size` to set the maximum size of `T` in `Box<T>` to be linted
[#10651](https://github.com/rust-lang/rust-clippy/pull/10651)
<!-- changelog_checked -->
Suggest `std::mem::size_of_val` instead of `std::mem::size_of_value`
This fixes the incorrect suggestion to use `std::mem::size_of_value`. It should be [`std::mem::size_of_val`](https://doc.rust-lang.org/std/mem/fn.size_of_val.html).
changelog: [`manual_slice_size_calculation`]: suggest `std::mem::size_of_val` rather than `std::mem::size_of_value`
Clippy Book Chapter Updates Reborn: Macro Expansions
This PR adds a new chapter to the book: "Macro Expansions". There weren't big changes apart from grammar, re-phrasing and stylistic choices.
## Notes
- **Does not require any other chapter** to be merged before this
- To talk about the whole project, please use the tracking issue for the project #10597 (It also contains a timeline, discussions and more information)
changelog: Add a new "Macro Expansions" chapter to the book
r? `@flip1995`
Book: Improve type checking and lint passes chapters
- Adds the lint passes chapter to the index.
- Moves additional reading material for beginners to the front page of the development section.
- Clarify some details in `hir::Ty` vs `ty::Ty`.
`@blyxyas` I started reviewing the chapters that were already merged. Great work. I liked the additional reading chapter so much, that I moved it front and center. Other than that I only had some minor corrections to make. Please review.
r? `@llogiq`
changelog: none
Adds the lint passes chapter to the index.
Moves additional reading material for beginners to the front page of the
development section.
Clarify some details in hir::Ty vs ty::Ty.
Clippy Book Chapter Updates Reborn: Lint Passes
This PR adds a new chapter to the book: "Lint passes". No major changes apart from some re-phrasing, fixing typos... etc.
## Notes
- Requires #10595 to be merged before this one (Or else, a link will be broken).
- To talk about the whole project, please use the tracking issue for the project #10597 (It also contains a timeline, discussions and more information)
changelog: Add a new "Lint passes" chapter to the book
r? `@flip1995`
Fix UB in `as_ptr_cast_mut` documentation
changelog: none
Fixes#10628
There's no `String::as_mut_ptr` surprisingly, so the example is actually calling `str::as_mut_ptr` on an empty `str`
Links to README.md files must actually be links to index.md files,
because of the inner workings of `mdbook`.
Also use the latest mdbook version in CI.
Clear with drain
Fixes#10572: both the original intent of the issue (extending `clear_with_drain`) and the false negative for `collection_is_never_read` I found in the process are fixed by this PR.
changelog: [`clear_with_drain`]: extend to 5 other types of containers. [`collection_is_never_read`]: fix false negative for `String`s.
remove unusued `#![feature(drain_filter)]`
The unstable feature does not appear to be used and its presence blocks work in https://github.com/rust-lang/rust/pull/104455
changelog: none
[missing_const_for_fn] fix#7121
*Please write a short comment explaining your change (or "none" for internal only changes)*
changelog: [`missing_const_for_fn`] note about removing const may break compatibility
fix#7121
Add `max_line_length` to `.editorconfig`, matching `rustfmt.toml`
Add `max_line_length` to `.editorconfig` to match the `max_width` in `rustfmt.toml`.
changelog: none