about summary refs log tree commit diff
path: root/clippy_utils/src/sugg.rs
AgeCommit message (Collapse)AuthorLines
2023-12-19Plumb awaitness of for loopsEric Holk-1/+1
2023-12-01Merge commit 'f0cdee4a3f094416189261481eae374b76792af1' into clippy-subtree-syncPhilipp Krones-5/+2
2023-11-28Rework `ast::BinOpKind::to_string` and `ast::UnOp::to_string`.Nicholas Nethercote-1/+1
- Rename them both `as_str`, which is the typical name for a function that returns a `&str`. (`to_string` is appropriate for functions returning `String` or maybe `Cow<'a, str>`.) - Change `UnOp::as_str` from an associated function (weird!) to a method. - Avoid needless `self` dereferences.
2023-11-03Auto merge of #117507 - nnethercote:rustc_span, r=Nilstriebbors-1/+1
`rustc_span` cleanups Just some things I found while looking over this crate. r? `@oli-obk`
2023-11-02Merge commit '09ac14c901abc43bd0d617ae4a44e8a4fed98d9c' into clippyupPhilipp Krones-1/+4
2023-11-02Minimize `pub` usage in `source_map.rs`.Nicholas Nethercote-1/+1
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-27Add gen blocks to ast and do some broken ast loweringOli Scherer-1/+1
2023-09-12Merge commit '98363cbf6a7c3f8b571a7d92a3c645bb4376e4a6' into clippyupPhilipp Krones-1/+1
2023-08-11Merge commit '1e8fdf492808a25d78a97e1242b835ace9924e4d' into clippyupPhilipp Krones-1/+1
2023-07-24Perform OpaqueCast field projection on HIR, too.Oli Scherer-0/+2
This is necessary for closure captures in 2021 edition, as they capture individual fields, not the full mentioned variables. So it may try to capture a field of an opaque (because the hidden type is known to be something with a field).
2023-07-17Merge commit 'd9c24d1b1ee61f276e550b967409c9f155eac4e3' into clippyupPhilipp Krones-1/+1
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-1/+1
2023-07-02Merge commit '37f4c1725d3fd7e9c3ffd8783246bc5589debc53' into clippyupPhilipp Krones-1/+1
2023-06-26Support `hir::ExprKind::Become` in clippyMaybe Waffle-0/+1
2023-06-19Support `ast::ExprKind::Become` in clippyMaybe Waffle-0/+1
2023-05-29Use `Cow` in `{D,Subd}iagnosticMessage`.Nicholas Nethercote-3/+3
Each of `{D,Subd}iagnosticMessage::{Str,Eager}` has a comment: ``` // FIXME(davidtwco): can a `Cow<'static, str>` be used here? ``` This commit answers that question in the affirmative. It's not the most compelling change ever, but it might be worth merging. This requires changing the `impl<'a> From<&'a str>` impls to `impl From<&'static str>`, which involves a bunch of knock-on changes that require/result in call sites being a little more precise about exactly what kind of string they use to create errors, and not just `&str`. This will result in fewer unnecessary allocations, though this will not have any notable perf effects given that these are error paths. Note that I was lazy within Clippy, using `to_string` in a few places to preserve the existing string imprecision. I could have used `impl Into<{D,Subd}iagnosticMessage>` in various places as is done in the compiler, but that would have required changes to *many* call sites (mostly changing `&format("...")` to `format!("...")`) which didn't seem worthwhile.
2023-05-05Merge commit '371120bdbf58a331db5dcfb2d9cddc040f486de8' into clippyupPhilipp Krones-8/+4
2023-05-01clean up Colon from clippyyukang-5/+6
2023-04-21offset_ofDrMeepster-0/+2
2023-03-24Merge commit 'd5e2a7aca55ed49fc943b7a07a8eba05ab5a0079' into clippyupPhilipp Krones-9/+1
2023-03-14Remove box expressions from HIRclubby789-1/+0
2023-03-12Remove `box_syntax` from AST and use in toolsclubby789-1/+0
2023-02-26Auto merge of #108474 - Jarcho:clippyup, r=Manishearthbors-4/+4
Update Clippy Seems like `@flip1995` so this is a couple days late. r? `@Manishearth`
2023-02-25Merge commit '149392b0baa4730c68f3c3eadf5c6ed7b16b85a4' into clippyupJason Newcomb-4/+4
2023-02-25Make clippy happyMichael Goulet-1/+1
2023-02-10Merge commit '0f7558148c22e53cd4608773b56cdfa50dcdeac3' into clippyupPhilipp Krones-1/+4
2023-01-28Remove `HirId -> LocalDefId` map from HIR.Camille GILLOT-4/+2
2023-01-26change fn_sig query to use EarlyBinder; remove bound_fn_sig query; add ↵Kyle Matsuda-1/+1
EarlyBinder to fn_sig in metadata
2023-01-26replace usages of fn_sig query with bound_fn_sigKyle Matsuda-1/+1
2023-01-12Make clippy compile.Mara Bos-0/+1
2022-12-29Auto merge of #106266 - matthiaskrgr:rollup-cxrdbzy, r=matthiaskrgrbors-1/+0
Rollup of 9 pull requests Successful merges: - #104531 (Provide a better error and a suggestion for `Fn` traits with lifetime params) - #105899 (`./x doc library --open` opens `std`) - #106190 (Account for multiple multiline spans with empty padding) - #106202 (Trim more paths in obligation types) - #106234 (rustdoc: simplify settings, help, and copy button CSS by not reusing) - #106236 (docs/test: add docs and a UI test for `E0514` and `E0519`) - #106259 (Update Clippy) - #106260 (Fix index out of bounds issues in rustdoc) - #106263 (Formatter should not try to format non-Rust files) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-29Merge commit '4f3ab69ea0a0908260944443c739426cc384ae1a' into clippyupPhilipp Krones-1/+0
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-12-01Merge commit 'd822110d3b5625b9dc80ccc442e06fc3cc851d76' into clippyupPhilipp Krones-29/+36
2022-11-21Merge commit 'f4850f7292efa33759b4f7f9b7621268979e9914' into clippyupPhilipp Krones-1/+1
2022-11-11Introduce `ExprKind::IncludedBytes`clubby789-0/+1
2022-10-23Merge commit '4f142aa1058f14f153f8bfd2d82f04ddb9982388' into clippyupflip1995-8/+5
2022-10-20rustc_hir_typeck: fix clippylcnr-4/+3
2022-10-19Add testcase for next_point, fix more trivial issues in ↵yukang-2/+1
find_width_of_character_at_span
2022-10-07Change InferCtxtBuilder from enter to buildCameron Steffen-4/+3
2022-10-06Merge commit 'ac0e10aa68325235069a842f47499852b2dee79e' into clippyupPhilipp Krones-29/+33
2022-09-27rustc_typeck to rustc_hir_analysislcnr-2/+2
2022-09-21Merge commit '7248d06384c6a90de58c04c1f46be88821278d8b' into sync-from-clippyDavid Koloski-22/+26
2022-09-05separate the receiver from arguments in HIR under /clippyTakayuki Maeda-11/+13
2022-08-11Merge commit '2b2190cb5667cdd276a24ef8b9f3692209c54a89' into clippyupPhilipp Krones-0/+6
2022-07-18Merge commit 'fdb84cbfd25908df5683f8f62388f663d9260e39' into clippyupPhilipp Krones-8/+22
2022-07-12Fix clippy buildMaybe Waffle-2/+2
2022-06-17remove the rest of unnecessary `to_string`Takayuki Maeda-1/+1
2022-06-12Make `ExprKind::Closure` a struct variant.Camille GILLOT-4/+4
2022-05-21Merge 'rust-clippy/master' into clippyupxFrednet-4/+1