about summary refs log tree commit diff
path: root/clippy_lints/src/methods
AgeCommit message (Collapse)AuthorLines
2022-10-23Merge commit '4f142aa1058f14f153f8bfd2d82f04ddb9982388' into clippyupflip1995-48/+41
2022-10-20rustc_hir_typeck: fix clippylcnr-1/+1
2022-10-07Change InferCtxtBuilder from enter to buildCameron Steffen-3/+1
2022-10-06Merge commit 'ac0e10aa68325235069a842f47499852b2dee79e' into clippyupPhilipp Krones-323/+236
2022-09-27rustc_typeck to rustc_hir_analysislcnr-2/+2
2022-09-24separate definitions and `HIR` ownersTakayuki Maeda-4/+4
fix a ui test use `into` fix clippy ui test fix a run-make-fulldeps test implement `IntoQueryParam<DefId>` for `OwnerId` use `OwnerId` for more queries change the type of `ParentOwnerIterator::Item` to `(OwnerId, OwnerNode)`
2022-09-21Merge commit '7248d06384c6a90de58c04c1f46be88821278d8b' into sync-from-clippyDavid Koloski-20/+133
2022-09-19remove the `Subst` trait, always use `EarlyBinder`lcnr-1/+0
2022-09-09Merge commit 'b52fb5234cd7c11ecfae51897a6f7fa52e8777fc' into clippyupPhilipp Krones-105/+196
2022-09-07Auto merge of #101432 - nnethercote:shrink-PredicateS, r=lcnrbors-4/+4
Shrink `PredicateS` r? `@ghost`
2022-09-06Auto merge of #101241 - camsteffen:refactor-binding-annotations, r=cjgillotbors-16/+10
`BindingAnnotation` refactor * `ast::BindingMode` is deleted and replaced with `hir::BindingAnnotation` (which is moved to `ast`) * `BindingAnnotation` is changed from an enum to a tuple struct e.g. `BindingAnnotation(ByRef::No, Mutability::Mut)` * Associated constants added for convenience `BindingAnnotation::{NONE, REF, MUT, REF_MUT}` One goal is to make it more clear that `BindingAnnotation` merely represents syntax `ref mut` and not the actual binding mode. This was especially confusing since we had `ast::BindingMode`->`hir::BindingAnnotation`->`thir::BindingMode`. I wish there were more symmetry between `ByRef` and `Mutability` (variant) naming (maybe `Mutable::Yes`?), and I also don't love how long the name `BindingAnnotation` is, but this seems like the best compromise. Ideas welcome.
2022-09-05refactor: remove unnecessary variablesTakayuki Maeda-12/+8
2022-09-05separate the receiver from arguments in HIR under /clippyTakayuki Maeda-160/+194
2022-09-05Pack `Term` in the same way as `GenericArg`.Nicholas Nethercote-4/+4
This shrinks the `PredicateS` type, which is instanted frequently.
2022-09-02clippy: BindingAnnotation changeCameron Steffen-16/+10
2022-08-31Merge commit 'f51aade56f93175dde89177a92e3669ebd8e7592' into clippyupJason Newcomb-48/+2224
2022-08-11Merge commit '2b2190cb5667cdd276a24ef8b9f3692209c54a89' into clippyupPhilipp Krones-17/+38
2022-07-29Avoid ICE when fetching LocalDefIdMiguel Guarniz-1/+2
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-28Merge commit '3c7e7dbc1583a0b06df5bd7623dd354a4debd23d' into clippyupPhilipp Krones-1/+77
2022-07-18Merge commit 'fdb84cbfd25908df5683f8f62388f663d9260e39' into clippyupPhilipp Krones-81/+82
2022-07-16Rollup merge of #99342 - TaKO8Ki:avoid-symbol-to-string-conversions, ↵Matthias Krüger-1/+1
r=compiler-errors Avoid some `Symbol` to `String` conversions This patch removes some Symbol to String conversions.
2022-07-17avoid some `Symbol` to `String` conversionsTakayuki Maeda-1/+1
2022-07-12Fix clippy buildMaybe Waffle-12/+12
2022-07-01Factor out hir::Node::BindingCameron Steffen-1/+1
2022-06-30Merge commit '0cb0f7636851f9fcc57085cf80197a2ef6db098f' into clippyupPhilipp Krones-2/+5
2022-06-20remove last use of MAX_SUGGESTION_HIGHLIGHT_LINESMaybe Waffle-10/+3
2022-06-19remove `span_lint_and_sugg_for_edges` from clippy utilsMaybe Waffle-7/+4
2022-06-16Merge commit 'd7b5cbf065b88830ca519adcb73fad4c0d24b1c7' into clippyupflip1995-154/+200
2022-06-15Rollup merge of #98110 - cjgillot:closure-brace, r=Aaron1011Yuki Okushi-38/+37
Make `ExprKind::Closure` a struct variant. Simple refactor since we both need it to introduce additional fields in `ExprKind::Closure`. r? ``@Aaron1011``
2022-06-13remove unnecessary `to_string` and `String::new`Takayuki Maeda-3/+3
2022-06-12Make `ExprKind::Closure` a struct variant.Camille GILLOT-38/+37
2022-06-04Merge commit 'd9ddce8a223cb9916389c039777b6966ea448dc8' into clippyupPhilipp Krones-64/+210
2022-05-23Lifetime variance fixes for clippyMichael Goulet-1/+1
2022-05-21Merge 'rust-clippy/master' into clippyupxFrednet-216/+248
2022-05-05Merge commit '7c21f91b15b7604f818565646b686d90f99d1baf' into clippyupflip1995-258/+471
2022-05-02rustc: Panic by default in `DefIdTree::parent`Vadim Petrochenkov-6/+6
Only crate root def-ids don't have a parent, and in majority of cases the argument of `DefIdTree::parent` cannot be a crate root. So we now panic by default in `parent` and introduce a new non-panicing function `opt_parent` for cases where the argument can be a crate root. Same applies to `local_parent`/`opt_local_parent`.
2022-04-08Merge commit '984330a6ee3c4d15626685d6dc8b7b759ff630bd' into clippyupflip1995-17/+179
2022-03-30Auto merge of #95436 - cjgillot:static-mut, r=oli-obkbors-1/+1
Remember mutability in `DefKind::Static`. This allows to compute the `BodyOwnerKind` from `DefKind` only, and removes a direct dependency of some MIR queries onto HIR. As a side effect, it also simplifies metadata, since we don't need 4 flavours of `EntryKind::*Static` any more.
2022-03-30get clippy to compile againlcnr-8/+9
2022-03-29Remember mutability in `DefKind::Static`.Camille GILLOT-1/+1
This allows to compute the `BodyOwnerKind` from `DefKind` only, and removes a direct dependency of some MIR queries onto HIR. As a side effect, it also simplifies metadata, since we don't need 4 flavours of `EntryKind::*Static` any more.
2022-03-24Merge commit 'd0cf3481a84e3aa68c2f185c460e282af36ebc42' into clippyupflip1995-104/+279
2022-03-14Merge commit 'dc5423ad448877e33cca28db2f1445c9c4473c75' into clippyupflip1995-104/+249
2022-03-11Improve `AdtDef` interning.Nicholas Nethercote-10/+10
This commit makes `AdtDef` use `Interned`. Much the commit is tedious changes to introduce getter functions. The interesting changes are in `compiler/rustc_middle/src/ty/adt.rs`.
2022-02-26Merge commit 'e329249b6a3a98830d860c74c8234a8dd9407436' into clippyupflip1995-2/+3
2022-02-15Overhaul `RegionKind` and `Region`.Nicholas Nethercote-2/+2
Specifically, change `Region` from this: ``` pub type Region<'tcx> = &'tcx RegionKind; ``` to this: ``` pub struct Region<'tcx>(&'tcx Interned<RegionKind>); ``` This now matches `Ty` and `Predicate` more closely. Things to note - Regions have always been interned, but we haven't been using pointer-based `Eq` and `Hash`. This is now happening. - I chose to impl `Deref` for `Region` because it makes pattern matching a lot nicer, and `Region` can be viewed as just a smart wrapper for `RegionKind`. - Various methods are moved from `RegionKind` to `Region`. - There is a lot of tedious sigil changes. - A couple of types like `HighlightBuilder`, `RegionHighlightMode` now have a `'tcx` lifetime because they hold a `Ty<'tcx>`, so they can call `mk_region`. - A couple of test outputs change slightly, I'm not sure why, but the new outputs are a little better.
2022-02-15Overhaul `TyS` and `Ty`.Nicholas Nethercote-17/+17
Specifically, change `Ty` from this: ``` pub type Ty<'tcx> = &'tcx TyS<'tcx>; ``` to this ``` pub struct Ty<'tcx>(Interned<'tcx, TyS<'tcx>>); ``` There are two benefits to this. - It's now a first class type, so we can define methods on it. This means we can move a lot of methods away from `TyS`, leaving `TyS` as a barely-used type, which is appropriate given that it's not meant to be used directly. - The uniqueness requirement is now explicit, via the `Interned` type. E.g. the pointer-based `Eq` and `Hash` comes from `Interned`, rather than via `TyS`, which wasn't obvious at all. Much of this commit is boring churn. The interesting changes are in these files: - compiler/rustc_middle/src/arena.rs - compiler/rustc_middle/src/mir/visit.rs - compiler/rustc_middle/src/ty/context.rs - compiler/rustc_middle/src/ty/mod.rs Specifically: - Most mentions of `TyS` are removed. It's very much a dumb struct now; `Ty` has all the smarts. - `TyS` now has `crate` visibility instead of `pub`. - `TyS::make_for_test` is removed in favour of the static `BOOL_TY`, which just works better with the new structure. - The `Eq`/`Ord`/`Hash` impls are removed from `TyS`. `Interned`s impls of `Eq`/`Hash` now suffice. `Ord` is now partly on `Interned` (pointer-based, for the `Equal` case) and partly on `TyS` (contents-based, for the other cases). - There are many tedious sigil adjustments, i.e. adding or removing `*` or `&`. They seem to be unavoidable.
2022-02-10Merge commit '57b3c4b90f4346b3990c1be387c3b3ca7b78412c' into clippyupflip1995-34/+37
2022-02-01remove `TyS::same_type`lcnr-8/+6
it ignored regions and constants in adts, but didn't do so for references or any other types. This seemed quite weird
2022-01-27Merge commit 'a98e7ab8b94485be6bd03e0c6b8682ecab5b52e6' into clippyupflip1995-3/+3
2022-01-21Remove a span from hir::ExprKind::MethodCallCameron Steffen-26/+27