-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clippy subtree update #134343
Clippy subtree update #134343
Conversation
…_formatting_args`
…formatting argument is passed
This is more likely to be intended as an intra-doc link than it is to be intended as a refdef. If a refdef is intended, it does not need to be nested within a list item or quote. ```markdown - [`LONG_INTRA_DOC_LINK`]: this looks like an intra-doc link, but is actually a refdef. The first line will seem to disappear when rendered as HTML. ```
Co-Authored-By: Jason Newcomb <jsnewcomb@pm.me>
Changelog: extended [`precedence`] to lint for bitmasking and bit shifting without parentheses
The compiler uses `BitSet<Local>`, because the number of locals doesn't get that high, so clippy should do likewise.
This updates the documentation after rust-lang#13694. It is not based on that PR chain and can be merged independently, but should be merged after that PR. This is partly pulled from rust-lang#12762, but removing the Josh parts. This includes instructions on how to publish `clippy_utils`. Closes rust-lang/rust-clippy#13556 (yes, this is the final PR 🙂) r? @blyxyas changelog: `clippy_utils` is now published to crates.io
…nishearth Clippy subtree update r? `@Manishearth`
…a different result
Fixes rust-lang/rust-clippy#10780 We correctly no longer give a warning when a closure is passed to a method, where one of the arguments to that method uses the variable which would be shadowed by an argument to that closure. Uses is defined loosely as any expression used in the calling expression mentions the shadowee binding (except for the closure itself): ```rust #![deny(clippy::shadow_unrelated)] let x = Some(1); let y = x.map(|x| x + 1); ``` will now succeed. See linebender/xilem#745 - without this change, all of the `expect(shadow_unrelated)` in the repository are met; with it, none of them are. changelog: [`shadow_unrelated`]: Don't treat closures arguments as unrelated when the calling function uses them
Remove Node::ArrayLenInfer
The new cases are `x.map(f)` and `x.map_err(f)` when `f` is `Into::into` or `From::from` with the same input and output types.
Fixes rust-lang#10195. changelog: Added new [`literal_string_with_formatting_args`] `pedantic` lint [rust-lang#13410](rust-lang/rust-clippy#13410)
…#13763) Close rust-lang#13703 changelog: none
Rename `ty_def_id` so people will stop using it by accident This function is just for cycle detection, but people keep using it because they think it's the right way of getting the def id from a `Ty` (and I can't blame them necessarily).
changelog: [`indexing_slicing`]: Clarify the relationship between indexing_slicing and out_of_bound_indexing, clarify that this lint is about possible panics based on runtime values, and fix array example to not trigger the out_of_bound_indexing lint.
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#134252 (Fix `Path::is_absolute` on Hermit) - rust-lang#134254 (Fix building `std` for Hermit after `c_char` change) - rust-lang#134255 (Update includes in `/library/core/src/error.rs`.) - rust-lang#134261 (Document the symbol Visibility enum) - rust-lang#134262 (Arbitrary self types v2: adjust diagnostic.) - rust-lang#134265 (Rename `ty_def_id` so people will stop using it by accident) - rust-lang#134271 (Arbitrary self types v2: better feature gate test) - rust-lang#134274 (Add check-pass test for `&raw`) r? `@ghost` `@rustbot` modify labels: rollup
…gs, r=oli-obk (Re-)Implement `impl_trait_in_bindings` This reimplements the `impl_trait_in_bindings` feature for local bindings. "`impl Trait` in bindings" serve as a form of *trait* ascription, where the type basically functions as an infer var but additionally registering the `impl Trait`'s trait bounds for the infer type. These trait bounds can be used to enforce that predicates hold, and can guide inference (e.g. for closure signature inference): ```rust let _: impl Fn(&u8) -> &u8 = |x| x; ``` They are implemented as an additional set of bounds that are registered when the type is lowered during typeck, and then these bounds are tied to a given `CanonicalUserTypeAscription` for borrowck. We enforce these `CanonicalUserTypeAscription` bounds during borrowck to make sure that the `impl Trait` types are sensitive to lifetimes: ```rust trait Static: 'static {} impl<T> Static for T where T: 'static {} let local = 1; let x: impl Static = &local; //~^ ERROR `local` does not live long enough ``` r? oli-obk cc rust-lang#63065 --- Why can't we just use TAIT inference or something? Well, TAITs in bodies have the problem that they cannot reference lifetimes local to a body. For example: ```rust type TAIT = impl Display; let local = 0; let x: TAIT = &local; //~^ ERROR `local` does not live long enough ``` That's because TAITs requires us to do *opaque type inference* which is pretty strict, since we need to remap all of the lifetimes of the hidden type to universal regions. This is simply not possible here. --- I consider this part of the "impl trait everywhere" experiment. I'm not certain if this needs yet another lang team experiment.
…ust-lang#13823) This addresses rust-lang/rust-clippy#13099 for the significant_drop_tightening lint. changelog: none
changelog: ``` changelog: [`needless_option_take`]: now lints for all temporary expressions of type Option<T>. ``` fixes rust-lang#13671 In general, needless_option_take should report whenever take() is called on a temporary value, not just when the temporary value is created by as_ref(). Also, we stop emitting machine applicable fixes in these cases, since sometimes the intention of the user is to actually clear the original option, in cases such as `option.as_mut().take()`.
r? @ghost changelog: none
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
r? matthiaskrgr |
@bors rollup=maybe |
@flip1995 @matthiaskrgr Hi clippy folks, I think #131808 is going to conflict with this one. Is it possible for clippy subtree bump to wait for #131808 then do a resync? |
🔒 Merge conflict This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again. How do I rebase?Assuming
You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial. Please avoid the "Resolve conflicts" button on GitHub. It uses Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Error message
|
I'll need a few days to get back to this. Probably until the weekend. |
🔒 Merge conflict This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again. How do I rebase?Assuming
You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial. Please avoid the "Resolve conflicts" button on GitHub. It uses Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Error message
|
Today is a new sync day. Closing in favor of the new sync, I'll open in a few minutes. |
r? @Manishearth