about summary refs log tree commit diff
path: root/src/tools/clippy/clippy_lints
AgeCommit message (Collapse)AuthorLines
2023-12-08coro_kind -> coroutine_kindMichael Goulet-1/+1
2023-12-08Auto merge of #118527 - Nadrieril:never_patterns_parse, r=compiler-errorsbors-2/+6
never_patterns: Parse match arms with no body Never patterns are meant to signal unreachable cases, and thus don't take bodies: ```rust let ptr: *const Option<!> = ...; match *ptr { None => { foo(); } Some(!), } ``` This PR makes rustc accept the above, and enforces that an arm has a body xor is a never pattern. This affects parsing of match arms even with the feature off, so this is delicate. (Plus this is my first non-trivial change to the parser). ~~The last commit is optional; it introduces a bit of churn to allow the new suggestions to be machine-applicable. There may be a better solution? I'm not sure.~~ EDIT: I removed that commit r? `@compiler-errors`
2023-12-06Drop clippy::vtable_address_comparisonsUrgau-67/+3
2023-12-04Fix buildEric Holk-1/+1
2023-12-04Update doctestEric Holk-2/+2
2023-12-04Remove bad mergeEric Holk-199/+0
2023-12-04Option<CoroutineKind>Eric Holk-1/+1
2023-12-04Merge Async and Gen into CoroutineKindEric Holk-0/+199
2023-12-03Parse a pattern with no armNadrieril-2/+6
2023-12-01Merge commit 'f0cdee4a3f094416189261481eae374b76792af1' into clippy-subtree-syncPhilipp Krones-850/+1500
2023-11-29Rollup merge of #118157 - Nadrieril:never_pat-feature-gate, r=compiler-errorsMatthias Krüger-2/+6
Add `never_patterns` feature gate This PR adds the feature gate and most basic parsing for the experimental `never_patterns` feature. See the tracking issue (https://github.com/rust-lang/rust/issues/118155) for details on the experiment. `@scottmcm` has agreed to be my lang-team liaison for this experiment.
2023-11-29Add `never_patterns` feature gateNadrieril-2/+6
2023-11-28Rework `ast::BinOpKind::to_string` and `ast::UnOp::to_string`.Nicholas Nethercote-9/+9
- 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-26rustc: `hir().local_def_id_to_hir_id()` -> `tcx.local_def_id_to_hir_id()` ↵Vadim Petrochenkov-28/+28
cleanup
2023-11-26Auto merge of #118250 - petrochenkov:optdefkind, r=compiler-errorsbors-3/+2
rustc: Make `def_kind` mandatory for all `DefId`s Prerequisite for https://github.com/rust-lang/rust/pull/118188.
2023-11-25Appease the clippyMichael Goulet-3/+3
2023-11-25rustc: Make `def_kind` mandatory for all `DefId`sVadim Petrochenkov-3/+2
2023-11-22Update itertools to 0.11.Nicholas Nethercote-1/+1
Because the API for `with_position` improved in 0.11 and I want to use it.
2023-11-19Don't sort `span_suggestions`, leave that to callerEsteban Küber-1/+2
2023-11-17rename bound region instantiationlcnr-18/+18
- `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-9724/+8706
2023-11-14finish `RegionKind` renamelcnr-3/+3
- `ReFree` -> `ReLateParam` - `ReEarlyBound` -> `ReEarlyParam`
2023-11-13update type flagslcnr-1/+1
- `HAS_RE_LATE_BOUND` -> `HAS_RE_BOUND` - `HAS_TY_LATE_BOUND` -> `HAS_TY_BOUND` - `HAS_CT_LATE_BOUND` -> `HAS_CT_BOUND` - `HAS_LATE_BOUND` -> `HAS_BOUND_VARS` - `fn has_late_bound_regions` -> `fn has_bound_regions` - `fnhas_non_region_late_bound` -> `fn has_non_region_bound_vars` - `fn has_late_bound_vars` -> `fn has_bound_vars`
2023-11-13rename `ReLateBound` to `ReBound`lcnr-4/+4
other changes: - `Region::new_late_bound` -> `Region::new_bound` - `Region::is_late_bound` -> `Region::is_bound`
2023-11-04fix clippy author and failing testDinu Blanovschi-2/+7
2023-11-03Auto merge of #117507 - nnethercote:rustc_span, r=Nilstriebbors-92/+72
`rustc_span` cleanups Just some things I found while looking over this crate. r? `@oli-obk`
2023-11-02Merge commit '09ac14c901abc43bd0d617ae4a44e8a4fed98d9c' into clippyupPhilipp Krones-3522/+3067
2023-11-02Minimize `pub` usage in `source_map.rs`.Nicholas Nethercote-92/+72
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-10-25Rename `AsyncCoroutineKind` to `CoroutineSource`Oli Scherer-10/+10
similar to how we have `MatchSource`, it explains where the desugaring came from.
2023-10-21Merge commit '2b030eb03d9e5837440b1ee0b98c50b97c0c5889' into clippyupPhilipp Krones-410/+756
2023-10-20s/generator/coroutine/Oli Scherer-16/+16
2023-10-20s/Generator/Coroutine/Oli Scherer-19/+19
2023-10-19Auto merge of #115214 - Urgau:rfc-3127-trim-paths, r=compiler-errorsbors-1/+1
Implement rustc part of RFC 3127 trim-paths This PR implements (or at least tries to) [RFC 3127 trim-paths](https://github.com/rust-lang/rust/issues/111540), the rustc part. That is `-Zremap-path-scope` with all of it's components/scopes. `@rustbot` label: +F-trim-paths
2023-10-17[RFC 3127 - Trim Paths]: Fix building tools (rustdoc, clippy, ...)Urgau-1/+1
2023-10-16fix lint failures in clippyArthur Lafrance-15/+15
2023-10-10Rejig some top-level `rustc_hir_pretty` functions.Nicholas Nethercote-2/+2
There are several that are unused and can be removed. And there are some calls to `to_string`, which can be expressed more nicely as a `foo_to_string` call, and then `to_string` need not be `pub`. (This requires adding `pat_to_string`).
2023-10-07Auto merge of #116437 - nnethercote:rustc_features, r=Nilstriebbors-1/+1
Clean up `rustc_features` Plenty more to be done, but this is a decent start. r? `@Nilstrieb`
2023-10-06Rollup merge of #116423 - eltociear:patch-22, r=flip1995Matthias Krüger-2/+2
Fix typo in attrs.rs documenation -> documentation
2023-10-06Merge commit 'b105fb4c39bc1a010807a6c076193cef8d93c109' into clippyupPhilipp Krones-166/+696
2023-10-05Add more diagnostic items for clippyJason Newcomb-213/+183
2023-10-05Rename `Features::active_features`.Nicholas Nethercote-1/+1
The word "active" is currently used in two different and confusing ways: - `ACTIVE_FEATURES` actually means "available unstable features" - `Features::active_features` actually means "features declared in the crate's code", which can include feature within `ACTIVE_FEATURES` but also others. (This is also distinct from "enabled" features which includes declared features but also some edition-specific features automatically enabled depending on the edition in use.) This commit changes the `Features::active_features` to `Features::declared_features` which actually matches its meaning. Likewise, `Features::active` becomes `Features::declared`.
2023-10-04Fix clippyMichael Goulet-6/+2
2023-10-05Fix typo in attrs.rsIkko Eltociear Ashimine-2/+2
documenation -> documentation
2023-10-01Auto merge of #115670 - Zoxc:outline-panic-macro-1, r=Mark-Simulacrumbors-4/+19
Partially outline code inside the panic! macro This outlines code inside the panic! macro in some cases. This is split out from https://github.com/rust-lang/rust/pull/115562 to exclude changes to rustc.
2023-09-29Rollup merge of #116245 - flip1995:clippy-backport, r=ManishearthMatthias Krüger-1/+1
Clippy backport: Move needless_raw_string_hashes to pedantic Really small backport this time. Context: https://github.com/rust-lang/rust-clippy/pull/11415#issuecomment-1739880932 I'd rather get this in 1.74 than waiting another release cycle. r? `@Manishearth` cc `@Mark-Simulacrum` This should be merged before beta is branched tomorrow.
2023-09-28Remove `rustc_lint_defs::lint_array`DaniPopes-2/+2
2023-09-28Move needless_raw_string_hashes to pedanticAlex Macleod-1/+1
2023-09-27Auto merge of #116163 - compiler-errors:lazyness, r=oli-obkbors-1/+1
Don't store lazyness in `DefKind::TyAlias` 1. Don't store lazyness of a type alias in its `DefKind`, but instead via a query. 2. This allows us to treat type aliases as lazy if `#[feature(lazy_type_alias)]` *OR* if the alias contains a TAIT, rather than having checks for both in separate parts of the codebase. r? `@oli-obk` cc `@fmease`
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.