New lint: detect unnecessary struct building
Fixes#10476.
Running this lint on the top 500 crates produced one hit (in `rust-lang/rust-bindgen`) and [a PR has been submitted there](https://github.com/rust-lang/rust-bindgen/pull/2440).
changelog: [`unnecessary_struct_initialization`]: new lint
Rollup of 7 pull requests
Successful merges:
- #108541 (Suppress `opaque_hidden_inferred_bound` for nested RPITs)
- #109137 (resolve: Querify most cstore access methods (subset 2))
- #109380 (add `known-bug` test for unsoundness issue)
- #109462 (Make alias-eq have a relation direction (and rename it to alias-relate))
- #109475 (Simpler checked shifts in MIR building)
- #109504 (Stabilize `arc_into_inner` and `rc_into_inner`.)
- #109506 (make param bound vars visibly bound vars with -Zverbose)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Updates `interpret`, `codegen_ssa`, and `codegen_cranelift` to consume the new cast instead of the intrinsic.
Includes `CastTransmute` for custom MIR building, to be able to test the extra UB.
The lint is very slow as it doesn't cache the deeply nested check for
the attribute. If we cache it, we can reduce the time spent on checking
`rustc_borrowck` from 28s to 9s, which is a nice improvement. In the
profile, the time inside `has_sig_drop_attr` goes from 66% to 0.2%,
which is a lot more reasonable.
See the PR for nice graphs.
Do not propose to simplify a not expression coming from a macro
Fixes#10523
changelog: FP [`nonminimal_bool`]: do not propose to change code coming from a macro
Do not propose to remove `async move` if variables are captured by ref
Fixes#10482
changelog: FP [`redundant_async_block`] Do not propose to remove `async move` if variables are captured by ref
a general type system cleanup
removes the helper functions `traits::fully_solve_X` as they add more complexity then they are worth. It's confusing which of these helpers should be used in which context.
changes the way we deal with overflow to always add depth in `evaluate_predicates_recursively`. It may make sense to actually fully transition to not have `recursion_depth` on obligations but that's probably a bit too much for this PR.
also removes some other small - and imo unnecessary - helpers.
r? types
Really dogfood clippy
The dogfood success condition was inverted in `tests/dogfood.rs`:
```rust
assert!(!failed_packages.is_empty(), …);
```
while instead the `failed_packages` collection must be empty:
```rust
assert!(failed_packages.is_empty(), …);
```
And indeed, several clippy lint source files were not clean and had to be fixed in the process.
changelog: none
The dogfood success condition was inverted in `tests/dogfood.rs`:
```rust
assert!(!failed_packages.is_empty(), …);
```
while instead the `failed_packages` collection must be empty:
```rust
assert!(failed_packages.is_empty(), …);
```
And indeed, several clippy lint source files were not clean and had to be
fixed in the process.
Use uninit checking from rustc
rustc has proper heuristics for actually checking whether a type allows being left uninitialized (by asking CTFE). We can now use this for our helper instead of rolling our own bad version with false positives.
I added this in rustc in rust-lang/rust#108669
Fix#10407
changelog: [`uninit_vec`]: fix false positives
changelog: [`uninit_assumed_init`]: fix false positives
rustc has proper heuristics for actually checking whether a type allows
being left uninitialized (by asking CTFE). We can now use this for our
helper instead of rolling our own bad version with false positives.
Correct active members link in `CONTRIBUTING.md`
This corrects the link, where to find which members are currently active and can be pinged. It also adds me as the code owner of `gh-pages`. In most cases, I'm asked to review those PRs anyways :)
Otherwise, not much more to day, have a great day!
---
Closes: #10521
changelog: none
<!-- changelog_checked -->
Issue function modifiers in the right order in manual_async_fn lint
Fixes#10450
changelog: [`manual_async_fn`] output function modifiers in correct order
Remove box expressions from HIR
After #108516, `#[rustc_box]` is used at HIR->THIR lowering and this is no longer emitted, so it can be removed.
This is based on top of #108471 to help with conflicts, so 43490488ccacd1a822e9c621f5ed6fca99959a0b is the only relevant commit (sorry for all the duplicated pings!)
````@rustbot```` label +S-blocked
fix `almost_swapped`: Ignore external macros
Fixes#10421 ; Related to #10499 (Fixing points *1* and *3* from #10421)
changelog: [`almost_swapped`]: Add a check to ignore external macros