about summary refs log tree commit diff
path: root/clippy_utils/src/hir_utils.rs
AgeCommit message (Collapse)AuthorLines
2024-01-12Delegation implementation: step 1Bryanskiy-1/+1
2024-01-11Merge commit '26ac6aab023393c94edf42f38f6ad31196009643'Philipp Krones-1/+1
2024-01-05Update clippy for hir::Guard removalMatthew Jasper-21/+3
2023-12-01Merge commit 'f0cdee4a3f094416189261481eae374b76792af1' into clippy-subtree-syncPhilipp Krones-2/+1
2023-11-29Add `never_patterns` feature gateNadrieril-0/+1
2023-11-16Merge commit 'edb720b199083f4107b858a8761648065bf38d86' into clippyupPhilipp Krones-33/+83
2023-11-02Merge commit '09ac14c901abc43bd0d617ae4a44e8a4fed98d9c' into clippyupPhilipp Krones-6/+2
2023-08-24Merge commit '080b587854a73f2a8cbaecff1884860a78e2ff37' into clippyupPhilipp Krones-1/+1
2023-08-23Fix clippy lint for identical `if`/`else` contraining `?` expressionsEsteban Küber-1/+2
Follow up to #114819.
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-11/+14
2023-07-17Merge commit 'd9c24d1b1ee61f276e550b967409c9f155eac4e3' into clippyupPhilipp Krones-2/+1
2023-06-26Support `hir::ExprKind::Become` in clippyMaybe Waffle-0/+3
2023-05-20Merge commit '435a8ad86c7a33bd7ffb91c59039943408d3b6aa' into clippyupPhilipp Krones-47/+159
2023-05-05Merge commit '371120bdbf58a331db5dcfb2d9cddc040f486de8' into clippyupPhilipp Krones-2/+2
2023-04-21offset_ofDrMeepster-0/+9
2023-03-28Add `(..)` syntax for RTNMichael Goulet-6/+1
2023-03-14Remove box expressions from HIRclubby789-2/+1
2023-02-25Make clippy happyMichael Goulet-2/+2
2022-12-28Rename `Rptr` to `Ref` in AST and HIRNilstrieb-2/+2
The name makes a lot more sense, and `ty::TyKind` calls it `Ref` already as well.
2022-11-27Auto merge of #104048 - cjgillot:split-lifetime, r=compiler-errorsbors-11/+5
Separate lifetime ident from lifetime resolution in HIR Drive-by: change how suggested generic args are computed. Fixes https://github.com/rust-lang/rust/issues/103815 I recommend reviewing commit-by-commit.
2022-11-25Rollup merge of #104873 - RalfJung:therefore, r=Dylan-DPCMatthias Krüger-1/+1
RefCell::get_mut: fix typo and fix the same typo in a bunch of other places
2022-11-25RefCell::get_mut: fix typoRalf Jung-1/+1
and fix the same typo in a bunch of other places
2022-11-23Separate lifetime ident from resolution in HIR.Camille GILLOT-11/+5
2022-11-21Merge commit 'f4850f7292efa33759b4f7f9b7621268979e9914' into clippyupPhilipp Krones-15/+18
2022-10-06Merge commit 'ac0e10aa68325235069a842f47499852b2dee79e' into clippyupPhilipp Krones-2/+2
2022-09-09Merge commit 'b52fb5234cd7c11ecfae51897a6f7fa52e8777fc' into clippyupPhilipp Krones-5/+5
2022-09-09Appease clippy againMichael Goulet-4/+2
2022-09-09Make clippy happyMichael Goulet-0/+3
2022-09-08Arena-allocate `hir::Lifetime`.Nicholas Nethercote-1/+1
This shrinks `hir::Ty` from 72 to 48 bytes. `visit_lifetime` is added to the HIR stats collector because these types are now stored in memory on their own, instead of being within other types.
2022-09-06Auto merge of #101241 - camsteffen:refactor-binding-annotations, r=cjgillotbors-5/+6
`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-05separate the receiver from arguments in HIR under /clippyTakayuki Maeda-3/+10
2022-09-02clippy: BindingAnnotation changeCameron Steffen-5/+6
2022-08-01Shrink `Token`.Nicholas Nethercote-2/+2
From 72 bytes to 12 bytes (on x86-64). There are two parts to this: - Changing various source code offsets from 64-bit to 32-bit. This is not a problem because the rest of rustc also uses 32-bit source code offsets. This means `Token` is no longer `Copy` but this causes no problems. - Removing the `RawStrError` from `LiteralKind`. Raw string literal invalidity is now indicated by a `None` value within `RawStr`/`RawByteStr`, and the new `validate_raw_str` function can be used to re-lex an invalid raw string literal to get the `RawStrError`. There is one very small change in behaviour. Previously, if a raw string literal matched both the `InvalidStarter` and `TooManyHashes` cases, the latter would override the former. This has now changed, because `raw_double_quoted_string` now uses `?` and so returns immediately upon detecting the `InvalidStarter` case. I think this is a slight improvement to report the earlier-detected error, and it explains the change in the `test_too_many_hashes` test. The commit also removes a couple of comments that refer to #77629 and say that the size of these types don't affect performance. These comments are wrong, though the performance effect is small.
2022-07-28Merge commit '3c7e7dbc1583a0b06df5bd7623dd354a4debd23d' into clippyupPhilipp Krones-29/+4
2022-07-18Merge commit 'fdb84cbfd25908df5683f8f62388f663d9260e39' into clippyupPhilipp Krones-5/+5
2022-07-14Rollup merge of #98705 - WaffleLapkin:closure_binder, r=cjgillotDylan DPC-3/+3
Implement `for<>` lifetime binder for closures This PR implements RFC 3216 ([TI](https://github.com/rust-lang/rust/issues/97362)) and allows code like the following: ```rust let _f = for<'a, 'b> |a: &'a A, b: &'b B| -> &'b C { b.c(a) }; // ^^^^^^^^^^^--- new! ``` cc ``@Aaron1011`` ``@cjgillot``
2022-07-12Fix clippy buildMaybe Waffle-3/+3
2022-07-11move else block into the `Local` structDing Xiang Fei-4/+4
2022-07-11lower let-else in MIR insteadDing Xiang Fei-2/+6
2022-06-30Merge commit '0cb0f7636851f9fcc57085cf80197a2ef6db098f' into clippyupPhilipp Krones-2/+42
2022-06-16Merge commit 'd7b5cbf065b88830ca519adcb73fad4c0d24b1c7' into clippyupflip1995-1/+13
2022-06-12Make `ExprKind::Closure` a struct variant.Camille GILLOT-3/+5
2022-06-04Merge commit 'd9ddce8a223cb9916389c039777b6966ea448dc8' into clippyupPhilipp Krones-3/+3
2022-06-03Manipulate lifetimes by LocalDefId for region resolution.Camille GILLOT-5/+3
2022-05-21Merge 'rust-clippy/master' into clippyupxFrednet-5/+3
2022-05-09fix clippySparrowLii-2/+4
2022-05-05Merge commit '7c21f91b15b7604f818565646b686d90f99d1baf' into clippyupflip1995-17/+25
2022-04-14Reimplement lowering of sym operands for asm! so that it also works with ↵Amanieu d'Antras-1/+2
global_asm!
2022-03-14Merge commit 'dc5423ad448877e33cca28db2f1445c9c4473c75' into clippyupflip1995-1/+5