about summary refs log tree commit diff
path: root/src/tools/clippy/clippy_utils
AgeCommit message (Collapse)AuthorLines
2023-11-03Auto merge of #117507 - nnethercote:rustc_span, r=Nilstriebbors-2/+2
`rustc_span` cleanups Just some things I found while looking over this crate. r? `@oli-obk`
2023-11-02Merge commit '09ac14c901abc43bd0d617ae4a44e8a4fed98d9c' into clippyupPhilipp Krones-253/+134
2023-11-02Minimize `pub` usage in `source_map.rs`.Nicholas Nethercote-2/+2
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-11-01Rename hook.Camille GILLOT-1/+1
2023-10-29Rename Since -> StableSince in preparation for a DeprecatedSinceDavid Tolnay-4/+4
2023-10-29Auto merge of #116447 - oli-obk:gen_fn, r=compiler-errorsbors-2/+2
Implement `gen` blocks in the 2024 edition Coroutines tracking issue https://github.com/rust-lang/rust/issues/43122 `gen` block tracking issue https://github.com/rust-lang/rust/issues/117078 This PR implements `gen` blocks that implement `Iterator`. Most of the logic with `async` blocks is shared, and thus I renamed various types that were referring to `async` specifically. An example usage of `gen` blocks is ```rust fn foo() -> impl Iterator<Item = i32> { gen { yield 42; for i in 5..18 { if i.is_even() { continue } yield i * 2; } } } ``` The limitations (to be resolved) of the implementation are listed in the tracking issue
2023-10-27Add gen blocks to ast and do some broken ast loweringOli Scherer-2/+2
2023-10-26Parse rustc version at compile timeDavid Tolnay-15/+8
2023-10-24Expose a non-Symbol way to access current rustc version stringDavid Tolnay-4/+3
2023-10-24Handle structured stable attribute 'since' version in clippyDavid Tolnay-12/+19
2023-10-21Merge commit '2b030eb03d9e5837440b1ee0b98c50b97c0c5889' into clippyupPhilipp Krones-94/+169
2023-10-20s/generator/coroutine/Oli Scherer-1/+1
2023-10-20s/Generator/Coroutine/Oli Scherer-1/+1
2023-10-18AliasTy::new instead of tcx methodlcnr-1/+1
2023-10-16fix lint failures in clippyArthur Lafrance-1/+1
2023-10-06Merge commit 'b105fb4c39bc1a010807a6c076193cef8d93c109' into clippyupPhilipp Krones-57/+91
2023-10-05Add more diagnostic items for clippyJason Newcomb-54/+4
2023-10-03Auto merge of #115025 - ouz-a:ouz_testing, r=lcnrbors-0/+1
Make subtyping explicit in MIR This adds new mir-opt that pushes new `ProjectionElem` called `ProjectionElem::Subtype(T)` to `Rvalue` of a subtyped assignment so we can unsoundness issues like https://github.com/rust-lang/rust/issues/107205 Addresses https://github.com/rust-lang/rust/issues/112651 r? `@lcnr`
2023-10-02subtyping_projectionsouz-a-0/+1
2023-10-01Auto merge of #115670 - Zoxc:outline-panic-macro-1, r=Mark-Simulacrumbors-3/+13
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-28Reverse postorder instead of using reversed postorderMaybe Waffle-13/+19
2023-09-27Auto merge of #116163 - compiler-errors:lazyness, r=oli-obkbors-2/+2
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-26Don't store lazyness in DefKindMichael Goulet-2/+2
2023-09-25Merge commit '7671c283a50b5d1168841f3014b14000f01dd204' into clippyupPhilipp Krones-37/+89
2023-09-22Add a way to decouple the implementation and the declaration of a TyCtxt method.Oli Scherer-1/+1
2023-09-22Auto merge of #114776 - fee1-dead-contrib:enable-effects-in-libcore, r=oli-obkbors-2/+3
Enable effects for libcore ~~r? `@oli-obk~~` forgot you are on vacation, oops
2023-09-22fix clippy errors (ignore effects in certainty)Deadbeef-2/+3
2023-09-21Record asyncness span in HIRMichael Goulet-3/+3
2023-09-21rename mir::Constant -> mir::ConstOperand, mir::ConstKind -> mir::ConstRalf Jung-13/+13
2023-09-19move ConstValue into mirRalf Jung-2/+2
this way we have mir::ConstValue and ty::ValTree as reasonably parallel
2023-09-14Auto merge of #115677 - matthewjasper:let-expr-recovery, r=b-naberbors-1/+1
Improve invalid let expression handling - Move all of the checks for valid let expression positions to parsing. - Add a field to ExprKind::Let in AST/HIR to mark whether it's in a valid location. - Suppress some later errors and MIR construction for invalid let expressions. - Fix a (drop) scope issue that was also responsible for #104172. Fixes #104172 Fixes #104868
2023-09-14fix clippy (and MIR printing) handling of ConstValue::Indirect slicesRalf Jung-13/+4
2023-09-14cleanup op_to_const a bit; rename ConstValue::ByRef → IndirectRalf Jung-1/+1
2023-09-14use AllocId instead of Allocation in ConstValue::ByRefRalf Jung-25/+28
2023-09-12Merge commit '98363cbf6a7c3f8b571a7d92a3c645bb4376e4a6' into clippyupPhilipp Krones-6/+26
2023-09-11Update tools and fulldeps testsMatthew Jasper-1/+1
2023-09-08Partially outline code inside the panic! macroJohn Kåre Alsaker-3/+13
2023-09-07Use `Freeze` for `SourceFile.lines`John Kåre Alsaker-1/+1
2023-09-03Use relative positions inside a SourceFile.Camille GILLOT-4/+4
2023-08-29Auto merge of #115183 - flip1995:clippyup, r=Manishearth,oli-obkbors-6/+4
Update Clippy r? `@oli-obk` Assigning you, because something broke with ui_test: ``` tests/ui/crashes/ice-7272.rs FAILED: command: "<unknown>" A bug in `ui_test` occurred: called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" } full stderr: ``` (and that 103 times) Thought I would ping you, before starting to investigate. Maybe you know what's going on.
2023-08-24Merge commit '080b587854a73f2a8cbaecff1884860a78e2ff37' into clippyupPhilipp Krones-6/+4
2023-08-24when terminating during unwinding, show the reason whyRalf Jung-1/+1
2023-08-23Fix clippy lint for identical `if`/`else` contraining `?` expressionsEsteban Küber-1/+2
Follow up to #114819.
2023-08-20give some unwind-related terminators a more clear nameRalf Jung-2/+2
2023-08-15Rollup merge of #114819 - estebank:issue-78124, r=compiler-errorsMatthias Krüger-3/+3
Point at return type when it influences non-first `match` arm When encountering code like ```rust fn foo() -> i32 { match 0 { 1 => return 0, 2 => "", _ => 1, } } ``` Point at the return type and not at the prior arm, as that arm has type `!` which isn't influencing the arm corresponding to arm `2`. Fix #78124.
2023-08-15Rollup merge of #114772 - fee1-dead-contrib:typed-did, r=b-naberGuillaume Gomez-4/+4
Add `{Local}ModDefId` to more strongly type DefIds` Based on #110862 by `@Nilstrieb`
2023-08-14Move scrutinee `HirId` into `MatchSource::TryDesugar`Esteban Küber-3/+3
2023-08-14Use `{Local}ModDefId` in many queriesNilstrieb-4/+4
2023-08-14Remove constness from `ImplSource::Param`Deadbeef-1/+1
2023-08-11Merge commit '1e8fdf492808a25d78a97e1242b835ace9924e4d' into clippyupPhilipp Krones-5/+14