about summary refs log tree commit diff
path: root/clippy_lints/src/methods
AgeCommit message (Collapse)AuthorLines
2024-01-11Merge commit '26ac6aab023393c94edf42f38f6ad31196009643'Philipp Krones-104/+641
2024-01-08Rustdoc and Clippy stop misusing Key for Ty -> (adt) DefIdMichael Goulet-10/+4
2024-01-06rustc_span: Optimize syntax context comparisonsVadim Petrochenkov-1/+1
Including comparisons with root context
2024-01-01Address unused tuple struct fields in clippyJake Goulding-8/+8
2023-12-28Merge commit 'ac4c2094a6030530661bee3876e0228ddfeb6b8b' into clippy-subtree-syncPhilipp Krones-26/+307
2023-12-25Fix clippy's usage of Body's coroutine_kindMichael Goulet-1/+0
Also fixes a bug where we weren't peeling blocks from async bodies
2023-12-16Merge commit 'a859e5cc1ce100df22346a1005da30532d04de59' into clippyupPhilipp Krones-22/+17
2023-12-12Move some methods from `tcx.hir()` to `tcx`zetanumbers-4/+4
Renamings: - find -> opt_hir_node - get -> hir_node - find_by_def_id -> opt_hir_node_by_def_id - get_by_def_id -> hir_node_by_def_id Fix rebase changes using removed methods Use `tcx.hir_node_by_def_id()` whenever possible in compiler Fix clippy errors Fix compiler Apply suggestions from code review Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com> Add FIXME for `tcx.hir()` returned type about its removal Simplify with with `tcx.hir_node_by_def_id`
2023-12-10remove redundant importssurechen-1/+1
detects redundant imports that can be eliminated. for #117772 : In order to facilitate review and modification, split the checking code and removing redundant imports code into two PR.
2023-12-01Merge commit 'f0cdee4a3f094416189261481eae374b76792af1' into clippy-subtree-syncPhilipp Krones-26/+237
2023-11-26rustc: `hir().local_def_id_to_hir_id()` -> `tcx.local_def_id_to_hir_id()` ↵Vadim Petrochenkov-1/+1
cleanup
2023-11-25Appease the clippyMichael Goulet-1/+1
2023-11-17rename bound region instantiationlcnr-3/+3
- `erase_late_bound_regions` -> `instantiate_bound_regions_with_erased` - `replace_late_bound_regions_X` -> `instantiate_bound_regions_X`
2023-11-16Merge commit 'edb720b199083f4107b858a8761648065bf38d86' into clippyupPhilipp Krones-1619/+1497
2023-11-03Auto merge of #117507 - nnethercote:rustc_span, r=Nilstriebbors-24/+16
`rustc_span` cleanups Just some things I found while looking over this crate. r? `@oli-obk`
2023-11-02Merge commit '09ac14c901abc43bd0d617ae4a44e8a4fed98d9c' into clippyupPhilipp Krones-505/+825
2023-11-02Minimize `pub` usage in `source_map.rs`.Nicholas Nethercote-24/+16
Most notably, this commit changes the `pub use crate::*;` in that file to `use crate::*;`. This requires a lot of `use` items in other crates to be adjusted, because everything defined within `rustc_span::*` was also available via `rustc_span::source_map::*`, which is bizarre. The commit also removes `SourceMap::span_to_relative_line_string`, which is unused.
2023-10-21Merge commit '2b030eb03d9e5837440b1ee0b98c50b97c0c5889' into clippyupPhilipp Krones-11/+17
2023-10-20s/generator/coroutine/Oli Scherer-1/+1
2023-10-16fix lint failures in clippyArthur Lafrance-1/+1
2023-10-06Merge commit 'b105fb4c39bc1a010807a6c076193cef8d93c109' into clippyupPhilipp Krones-12/+12
2023-10-05Add more diagnostic items for clippyJason Newcomb-39/+36
2023-10-04Fix clippyMichael Goulet-6/+2
2023-09-26Auto merge of #116144 - lcnr:subst-less, r=oli-obkbors-2/+2
subst -> instantiate continues #110793, there are still quite a few uses of `subst` and `substitute`, but changing them all in the same PR was a bit too much, so I've stopped here for now.
2023-09-26subst -> instantiatelcnr-2/+2
2023-09-25Merge commit '7671c283a50b5d1168841f3014b14000f01dd204' into clippyupPhilipp Krones-14/+186
2023-09-12Merge commit '98363cbf6a7c3f8b571a7d92a3c645bb4376e4a6' into clippyupPhilipp Krones-11/+155
2023-08-24Merge commit '080b587854a73f2a8cbaecff1884860a78e2ff37' into clippyupPhilipp Krones-28/+160
2023-08-14Move scrutinee `HirId` into `MatchSource::TryDesugar`Esteban Küber-2/+2
2023-08-11Merge commit '1e8fdf492808a25d78a97e1242b835ace9924e4d' into clippyupPhilipp Krones-130/+224
2023-08-10Revert "New lint [`filter_map_bool_then`]"Catherine Flores-79/+0
This reverts commits 978b1daf99d8326718684381704902fdaaf71b18 and 3235d9d612909bc64550eea3a0d387e1187e93dd.
2023-08-04Improve spans for indexing expressionsNilstrieb-2/+2
Indexing is similar to method calls in having an arbitrary left-hand-side and then something on the right, which is the main part of the expression. Method calls already have a span for that right part, but indexing does not. This means that long method chains that use indexing have really bad spans, especially when the indexing panics and that span in coverted into a panic location. This does the same thing as method calls for the AST and HIR, storing an extra span which is then put into the `fn_span` field in THIR.
2023-07-31Merge commit '5436dba826191964ac1d0dab534b7eb6d4c878f6' into clippyupPhilipp Krones-185/+814
2023-07-25Add `sym::iter_mut` + `sym::as_mut_ptr`blyxyas-1/+1
2023-07-17Merge commit 'd9c24d1b1ee61f276e550b967409c9f155eac4e3' into clippyupPhilipp Krones-130/+393
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-58/+58
2023-07-05Move `TyCtxt::mk_x` to `Ty::new_x` where applicableBoxy-3/+3
2023-07-02Merge commit '37f4c1725d3fd7e9c3ffd8783246bc5589debc53' into clippyupPhilipp Krones-151/+665
2023-06-26Migrate predicates_of and caller_bounds to ClauseMichael Goulet-6/+6
2023-06-19s/Clause/ClauseKindMichael Goulet-6/+6
2023-06-02Merge commit '30448e8cf98d4754350db0c959644564f317bc0f' into clippyupPhilipp Krones-1/+1
2023-05-29EarlyBinder::new -> EarlyBinder::bindlcnr-3/+3
2023-05-28Replace EarlyBinder(x) with EarlyBinder::new(x)Kyle Matsuda-3/+3
2023-05-20Merge commit '435a8ad86c7a33bd7ffb91c59039943408d3b6aa' into clippyupPhilipp Krones-11/+142
2023-05-06changes from review: add FIXME to clippy and change subst_identity to ↵Kyle Matsuda-0/+3
skip_binder in mir subst methods
2023-05-06make (try_)subst_and_normalize_erasing_regions take EarlyBinderKyle Matsuda-1/+1
2023-05-05Merge commit '371120bdbf58a331db5dcfb2d9cddc040f486de8' into clippyupPhilipp Krones-8/+8
2023-05-04Auto merge of #110806 - WaffleLapkin:unmkI, r=lcnrbors-4/+2
Replace `tcx.mk_trait_ref` with `TraitRef::new` First step in implementing https://github.com/rust-lang/compiler-team/issues/616 r? `@lcnr`
2023-05-03Restrict `From<S>` for `{D,Subd}iagnosticMessage`.Nicholas Nethercote-2/+2
Currently a `{D,Subd}iagnosticMessage` can be created from any type that impls `Into<String>`. That includes `&str`, `String`, and `Cow<'static, str>`, which are reasonable. It also includes `&String`, which is pretty weird, and results in many places making unnecessary allocations for patterns like this: ``` self.fatal(&format!(...)) ``` This creates a string with `format!`, takes a reference, passes the reference to `fatal`, which does an `into()`, which clones the reference, doing a second allocation. Two allocations for a single string, bleh. This commit changes the `From` impls so that you can only create a `{D,Subd}iagnosticMessage` from `&str`, `String`, or `Cow<'static, str>`. This requires changing all the places that currently create one from a `&String`. Most of these are of the `&format!(...)` form described above; each one removes an unnecessary static `&`, plus an allocation when executed. There are also a few places where the existing use of `&String` was more reasonable; these now just use `clone()` at the call site. As well as making the code nicer and more efficient, this is a step towards possibly using `Cow<'static, str>` in `{D,Subd}iagnosticMessage::{Str,Eager}`. That would require changing the `From<&'a str>` impls to `From<&'static str>`, which is doable, but I'm not yet sure if it's worthwhile.
2023-04-28uplift `clippy::clone_double_ref` as `suspicious_double_ref_op`Deadbeef-62/+2