Lintcheck maintenance
Make `cargo lintcheck -j 0` use all threads instead of panicking, and cleanup (and shorten) lintcheck's parsing code.
changelog: none
This makes the code shorter and clearer.
The only incompatible change is that an explicit command-line argument
`--crates-toml=` will take precedence over the `LINTCHECK_TOML`
environment variable.
Using `rayon::current_num_threads()` causes a bug:
```
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value:
ThreadPoolBuildError { kind: GlobalPoolAlreadyInitialized }',
src/main.rs:632:10
```
Moreover, using the number of threads and dividing it by 2 wouldn't
return the number of physical threads on modern processors which have
a varying number of threads per core.
It makes little sense to restrict ourselves to physical threads,
especially when, in modern architectures, cores with multiple threads
are often faster (performance) while cores with a unique threads are
often slower (efficient). The Rust runtime will make a better choice.
Downgrade let_underscore_untyped to restriction
From reading #6842 I am not convinced of the cost/benefit of this lint even as a pedantic lint.
It sounds like the primary motivation was to catch cases of `fn() -> Result` being changed to `async fn() -> Result`. If the original Result was ignored by a `let _`, then the compiler wouldn't guide you to add `.await`. **However, this situation is caught in a more specific way by [let_underscore_future](https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_future) which was introduced _after_ the original suggestion (#9760).**
In #10410 it was mentioned twice that a <kbd>restriction</kbd> lint might be more appropriate for let_underscore_untyped.
changelog: Moved [`let_underscore_untyped`] to restriction
Update version attribute for 1.68 lints
Roses are red,
violets are blue,
I'm running out of rhymes,
changelogs are crimes????
---
changelog: none
<!-- changelog_checked -->
Two small documentation improvements
The `wrong_self_convention` changes are for grammar and accuracy.
The `must_use_candidate` change is because that lint flags only exported functions: 8b65632b6e/clippy_lints/src/functions/must_use.rs (L27-L31)
changelog: `wrong_self_convention` and `must_use_candidate` documentation improvements
Scope `missing_docs_in_private_items` to only private items
`missing_docs_in_private_items` currently detects missing docs for public items as well as private. Since `missing_docs`already covers public items, this PR updates `missing_docs_in_private_items` to only cover private items.
Fixes#1895
changelog: [`missing_docs_in_private_items`]: Apply lint only to private items (used to be public and private)
Run dogfood to completion
Run dogfood on all packages before failing the test. Failing early is painful on lints which trigger on multiple crates.
changelog: None
Fix ICE in `multiple_unsafe_ops_per_block`
fixes#10367
changelog: [`multiple_unsafe_ops_per_block`]: Fix ICE when calling a function-like object in an unsafe block
Fix array-size-threshold config deserialization error
changelog: Fix error when providing an `array-size-threshold` in `clippy.toml`
Not entirely sure why it doesn't want to deserialize a u128, but converting it after the fact is an easy enough fix
Fixes#10422
Do not suggest to derive `Default` on generics with implicit arguments
Fixes#10396
changelog: FP: [`derivable_impls`]: do not suggest to derive `Default` on generics with implicit arguments
chore: remove unneeded rustfmt skip
---
The associated rustfmt bug that originally necessitated these skips was resolved a while back, so these are no longer necessary
changelog: none
Do not panic when analyzing the malformed origin of a format string
Fixes#10148. This will trigger only when generating format strings while accepting weird things in a procedural macro and setting the span to something which is not a string.
changelog: none
Fix test function checker in `unwrap_used`, `expect_used`
After #9686 , `unwrap` and `expect` in integration tests and raw test functions won't be allowed.
fixes#10011fixes#10238fixes#10264
---
changelog: Fix: [`expect_used`], [`unwrap_used`], [`dbg_macro`], [`print_stdout`], [`print_stderr`]: No longer lint in test functions, if the related configuration is set
[#10391](https://github.com/rust-lang/rust-clippy/pull/10391)
<!-- changelog_checked -->
Add new lint no_mangle_with_rust_abi
Fixes issue #10347
This PR adds a new lint `no_mangle_with_rust_abi` that suggests converting a function to the C ABI to if the function has the `#[no_mangle]` attribute and `Abi == Abi::Rust`. It will not run for any of the other variants defined in [rustc_target::spec::abi::Abi](https://doc.rust-lang.org/beta/nightly-rustc/rustc_target/spec/abi/enum.Abi.html), nor suggest any conversion other than conversion to the C ABI.
Functions that explicitly opt into the Rust ABI with `extern "Rust"` are ignored by this lint.
---
changelog: [`no_mangle_with_rust_abi`]: add lint that converts Rust ABI functions with the `#[no_mangle]` attribute to C ABI
Fix more false positives for `extra_unused_type_parameters`
Builds on #10321. All empty functions are no longer linted, instead of just those that have trait bounds on them. Also, if a trait bound contains a non-public trait (un-exported, but still potentially reachable), then the corresponding type parameter isn't linted.
Finally, added support for the `avoid_breaking_exported_api` config option.
r? `@flip1995`
changelog: none