needless_collect: Lint cases with type annotations for indirect usage and recognize `BinaryHeap`
fixes#7110
changelog: needless_collect: Lint cases with type annotations for indirect usage and recognize `BinaryHeap`.
Move all `sys::ext` modules to `os`
This PR moves all `sys::ext` modules to `os`, centralizing the location of all `os` code and simplifying the dependencies between `os` and `sys`.
Because this also removes all uses `cfg_if!` on publicly exported items, where after #81969 there were still a few left, this should properly work around https://github.com/rust-analyzer/rust-analyzer/issues/6038.
`@rustbot` label: +T-libs-impl
Update BARE_TRAIT_OBJECT and ELLIPSIS_INCLUSIVE_RANGE_PATTERNS to errors in Rust 2021
This addresses https://github.com/rust-lang/rust/pull/81244 by updating two lints to errors in the Rust 2021 edition.
r? `@estebank`
[single_char_pattern] add strip_prefix and strip_suffix
Title says it all. Adjusted ui tests.
I added the second commit in case you don't like that I moved that table into `single_char_pattern.rs` directly. I don't see any reason why it shouldn't be in that file. It isn't used anywhere else.
*Please write a short comment explaining your change (or "none" for internal only changes)*
changelog: add strip_prefix and strip_suffix to single_char_pattern lint
`Conf` macro improvements part 2
changelog: none
Follow-up to #7150
I made the default value required again for `define_Conf!` so that it can be parsed by the magic Python. I guess it's just as well for readability.
r? `@flip1995`
`Conf` macro improvements
changelog: Allow `default_trait_access` in macros
Mainly this is a change to use serde as in [Manually implementing Deserialize for a struct](https://serde.rs/deserialize-struct.html), which opens the door for a cleaner implementation overall.
* Allow `default_trait_access` in macros (tangential, but used in this PR)
* Deserialize into `TryConf { conf, errors }` instead of using a global `ERRORS` variable.
* Improve the `define_Conf!` macro
* Remove the redundant string literal `(name, "name", ..)`
* Support deprecated configs with `#[conf_deprecated(message)]`. Message shows in error.
* Make the default value optional. Use `Default::default()` if omitted.
* Invalid config value error now shows the key (see test output)
* Cleaner `impl Default for Conf` (no `toml::from_str("")`)
while_immutable_cond: check condition for mutation
This fixes#6689 by also checking the bindings mutated in the condition, whereas it was previously only checked in the loop body.
---
changelog: Fix FP in [`while_immutable_cond`] where mutation in the loop variable wasn't picked up.
`implicit_return` improvements
fixes: #6940
changelog: Fix `implicit_return` suggestion for async functions
changelog: Improve `implicit_return` suggestions when returning the result of a macro
changelog: Check for `break` expressions inside a loop which are then implicitly returned
changelog: Allow all diverging functions in `implicit_return`, not just panic functions
Implement RFC 1260 with feature_name `imported_main`.
This is the second extraction part of #84062 plus additional adjustments.
This (mostly) implements RFC 1260.
However there's still one test case failure in the extern crate case. Maybe `LocalDefId` doesn't work here? I'm not sure.
cc https://github.com/rust-lang/rust/issues/28937
r? `@petrochenkov`
Remove leftover plugin conf_file code
changelog: none
Removes dead code that used to support the following syntax:
```rust
#![plugin(clippy(conf_file="path/to/clippy's/configuration"))]
```
RLS (and others?) will need to remove the `&[]` from `clippy_lints::read_conf(&[], sess)`.
r? `@flip1995`