summary refs log tree commit diff
path: root/src/tools/clippy/clippy_lints
AgeCommit message (Collapse)AuthorLines
2023-07-06Ignore in-proc-macros itemsblyxyas-1/+2
2023-07-06Move redundant_clone to nurseryAlex Macleod-1/+1
2023-07-06Auto merge of #10865 - Centri3:let_with_type_underscore_tracing, r=Jarchobors-2/+10
[`let_with_type_underscore`]: Don't emit on locals from procedural macros closes #10498 changelog: [`let_with_type_underscore`]: Don't emit on locals from procedural macros
2023-07-06[`default_constructed_unit_structs`]: do not lint type aliasesy21-2/+13
2023-05-21Rename `forget_ref` lint to `forgetting_references`Urgau-2/+2
2023-05-21Rename `drop_ref` lint to `dropping_references`Urgau-2/+2
2023-05-21Rename `forget_copy` lint to `forgetting_copy_types`Urgau-2/+2
2023-05-21Rename `drop_copy` lint to `dropping_copy_types`Urgau-2/+2
2023-05-20Merge commit '435a8ad86c7a33bd7ffb91c59039943408d3b6aa' into clippyupPhilipp Krones-446/+956
2023-05-17Rollup merge of #111648 - Nilstrieb:language-items, r=WaffleLapkinDylan DPC-4/+5
Remove `LangItems::require` It's just a short wrapper used by `tcx.require_lang_item`. Deleting it gives us a negative diff.
2023-05-16Remove `LangItems::require`Nilstrieb-4/+5
It's just a short wrapper used by `tcx.require_lang_item`. Deleting it gives us a negative diff.
2023-05-10Drop uplifted clippy::forget_copyUrgau-34/+3
2023-05-10Drop uplifted clippy::forget_refUrgau-28/+3
2023-05-10Drop uplifted clippy::drop_copyUrgau-28/+3
2023-05-10Drop uplifted clippy::drop_refUrgau-29/+3
2023-05-08Rollup merge of #109410 - fmease:iat-alias-kind-inherent, r=compiler-errorsMichael Goulet-0/+1
Introduce `AliasKind::Inherent` for inherent associated types Allows us to check (possibly generic) inherent associated types for well-formedness. Type inference now also works properly. Follow-up to #105961. Supersedes #108430. Fixes #106722. Fixes #108957. Fixes #109768. Fixes #109789. Fixes #109790. ~Not to be merged before #108860 (`AliasKind::Weak`).~ CC `@jackh726` r? `@compiler-errors` `@rustbot` label T-types F-inherent_associated_types
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-05Auto merge of #111255 - flip1995:clippyup, r=Manishearthbors-119/+477
Update Clippy r? `@Manishearth`
2023-05-05Merge commit '371120bdbf58a331db5dcfb2d9cddc040f486de8' into clippyupPhilipp Krones-119/+477
2023-05-05Rollup merge of #108801 - fee1-dead-contrib:c-str, r=compiler-errorsDylan DPC-3/+9
Implement RFC 3348, `c"foo"` literals RFC: https://github.com/rust-lang/rfcs/pull/3348 Tracking issue: #105723
2023-05-04IAT: Introduce AliasKind::InherentLeón Orell Valerian Liehr-0/+1
2023-05-04Auto merge of #110806 - WaffleLapkin:unmkI, r=lcnrbors-7/+4
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-7/+7
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-05-02rm diag item, use lang itemDeadbeef-3/+3
2023-05-02initial step towards implementing C string literalsDeadbeef-0/+6
2023-05-02Rollup merge of #110955 - fee1-dead-contrib:sus-operation, r=compiler-errorsDylan DPC-63/+3
uplift `clippy::clone_double_ref` as `suspicious_double_ref_op` Split from #109842. r? ``@compiler-errors``
2023-04-28uplift `clippy::clone_double_ref` as `suspicious_double_ref_op`Deadbeef-63/+3
2023-04-27Make clippy happyMichael Goulet-1/+1
2023-04-26Fix uses of `TraitRef::identity` in clippy and rustdocMaybe Waffle-6/+3
2023-04-25Rollup merge of #110556 - kylematsuda:earlybinder-explicit-item-bounds, ↵Matthias Krüger-3/+2
r=compiler-errors Switch to `EarlyBinder` for `explicit_item_bounds` Part of the work to finish https://github.com/rust-lang/rust/issues/105779. This PR adds `EarlyBinder` to the return type of the `explicit_item_bounds` query and removes `bound_explicit_item_bounds`. r? `@compiler-errors` (hope it's okay to request you, since you reviewed #110299 and #110498 :smiley:)
2023-04-25Use `ty::TraitRef::new` in clippyMaybe Waffle-1/+1
2023-04-24Auto merge of #110718 - flip1995:clippyup, r=Manishearthbors-128/+298
Update Clippy r? `@Manishearth` A few days late, I was on a business trip, sorry.
2023-04-23Auto merge of #108118 - oli-obk:lazy_typeck, r=cjgillotbors-2/+2
Run various queries from other queries instead of explicitly in phases These are just legacy leftovers from when rustc didn't have a query system. While there are more cleanups of this sort that can be done here, I want to land them in smaller steps. This phased order of query invocations was already a lie, as any query that looks at types (e.g. the wf checks run before) can invoke e.g. const eval which invokes borrowck, which invokes typeck, ...
2023-04-23Merge commit 'a3ed905928a03b6e433d0b429190bf3a847128b3' into clippyupPhilipp Krones-128/+298
2023-04-22Auto merge of #106934 - DrMeepster:offset_of, r=WaffleLapkinbors-1/+7
Add offset_of! macro (RFC 3308) Implements https://github.com/rust-lang/rfcs/pull/3308 (tracking issue #106655) by adding the built in macro `core::mem::offset_of`. Two of the future possibilities are also implemented: * Nested field accesses (without array indexing) * DST support (for `Sized` fields) I wrote this a few months ago, before the RFC merged. Now that it's merged, I decided to rebase and finish it. cc `@thomcc` (RFC author)
2023-04-21Allow `LocalDefId` as the argument to `def_path_str`Oli Scherer-2/+2
2023-04-21offset_ofDrMeepster-1/+7
2023-04-20add EarlyBinder to output of explicit_item_bounds; replace ↵Kyle Matsuda-1/+1
bound_explicit_item_bounds usages; remove bound_explicit_item_bounds query
2023-04-20change usages of explicit_item_bounds to bound_explicit_item_boundsKyle Matsuda-4/+3
2023-04-20Remove WithOptconstParam.Camille GILLOT-5/+3
2023-04-16Alloc `hir::Lit` in an arena to remove the destructor from `Expr`Nilstrieb-5/+5
This allows allocating `Expr`s into a dropless arena, which is useful for using length prefixed thing slices in HIR, since these can only be allocated in the dropless arena and not in a typed arena. This is something I'm working on.
2023-04-11Merge commit '83e42a2337dadac915c956d125f1d69132f36425' into clippyupPhilipp Krones-513/+1468
2023-04-06Make elaborator genericMichael Goulet-1/+1
2023-04-04Rename `ast::Static` to `ast::StaticItem` to match `ast::ConstItem`Oli Scherer-2/+2
2023-04-04box a bunch of large typesOli Scherer-2/+2
2023-04-04Split out ast::ItemKind::Const into its own structOli Scherer-2/+2
2023-04-04rust-analyzer guided tuple field to named fieldOli Scherer-1/+1
2023-04-04rust-analyzer guided enum variant structificationOli Scherer-2/+2
2023-03-31Auto merge of #109010 - compiler-errors:rtn, r=eholkbors-7/+8
Initial support for return type notation (RTN) See: https://smallcultfollowing.com/babysteps/blog/2023/02/13/return-type-notation-send-bounds-part-2/ 1. Only supports `T: Trait<method(): Send>` style bounds, not `<T as Trait>::method(): Send`. Checking validity and injecting an implicit binder for all of the late-bound method generics is harder to do for the latter. * I'd add this in a follow-up. 3. ~Doesn't support RTN in general type position, i.e. no `let x: <T as Trait>::method() = ...`~ * I don't think we actually want this. 5. Doesn't add syntax for "eliding" the function args -- i.e. for now, we write `method(): Send` instead of `method(..): Send`. * May be a hazard if we try to add it in the future. I'll probably add it in a follow-up later, with a structured suggestion to change `method()` to `method(..)` once we add it. 7. ~I'm not in love with the feature gate name 😺~ * I renamed it to `return_type_notation` :heavy_check_mark: Follow-up PRs will probably add support for `where T::method(): Send` bounds. I'm not sure if we ever want to support return-type-notation in arbitrary type positions. I may also make the bounds require `..` in the args list later. r? `@ghost`