about summary refs log tree commit diff
path: root/src/tools/clippy
AgeCommit message (Collapse)AuthorLines
2022-01-16Auto merge of #92805 - BoxyUwU:revert-lazy-anon-const-substs, r=lcnrbors-39/+41
partially revertish `lazily "compute" anon const default substs` reverts #87280 except for some of the changes around `ty::Unevaluated` having a visitor and a generic for promoted why revert: <https://github.com/rust-lang/rust/pull/92805#issuecomment-1010736049> r? `@lcnr`
2022-01-16Auto merge of #92740 - cuviper:update-rayons, r=Mark-Simulacrumbors-1/+1
Update rayon and rustc-rayon This updates rayon for various tools and rustc-rayon for the compiler's parallel mode. - rayon v1.3.1 -> v1.5.1 - rayon-core v1.7.1 -> v1.9.1 - rustc-rayon v0.3.1 -> v0.3.2 - rustc-rayon-core v0.3.1 -> v0.3.2 ... and indirectly, this updates all of crossbeam-* to their latest versions. Fixes #92677 by removing crossbeam-queue, but there's still a lingering question about how tidy discovers "runtime" dependencies. None of this is truly in the standard library's dependency tree at all.
2022-01-15Return a LocalDefId in get_parent_item.Camille GILLOT-39/+39
2022-01-15nyahggdshjjghsdfhgsfEllen-9/+7
2022-01-15initial revertEllen-40/+44
2022-01-14Rollup merge of #92849 - flip1995:clippyup, r=ManishearthMatthias Krüger-1682/+3256
Clippyup r? ```@Manishearth```
2022-01-13Auto merge of #89861 - nbdd0121:closure, r=wesleywiserbors-2/+2
Closure capture cleanup & refactor Follow up of #89648 Each commit is self-contained and the rationale/changes are documented in the commit message, so it's advisable to review commit by commit. The code is significantly cleaner (at least IMO), but that could have some perf implication, so I'd suggest a perf run. r? `@wesleywiser` cc `@arora-aman`
2022-01-13Fix Clippy sync falloutflip1995-3/+3
2022-01-13Merge commit '97a5daa65908e59744e2bc625b14849352231c75' into clippyupflip1995-1682/+3256
2022-01-11Store a `Symbol` instead of an `Ident` in `VariantDef`/`FieldDef`Aaron Hill-4/+4
The field is also renamed from `ident` to `name. In most cases, we don't actually need the `Span`. A new `ident` method is added to `VariantDef` and `FieldDef`, which constructs the full `Ident` using `tcx.def_ident_span()`. This method is used in the cases where we actually need an `Ident`. This makes incremental compilation properly track changes to the `Span`, without all of the invalidations caused by storing a `Span` directly via an `Ident`.
2022-01-10Update rayon and rustc-rayonJosh Stone-1/+1
2022-01-09rustc_metadata: Rename `item_children(_untracked)` to ↵Vadim Petrochenkov-6/+6
`module_children(_untracked)` And `each_child_of_item` to `for_each_module_child`
2022-01-09rustc_metadata: Optimize and document module children decodingVadim Petrochenkov-12/+19
2022-01-07Remove region from UpvarCapture and move it to CapturedPlaceGary Guo-1/+1
Region info is completely unnecessary for upvar capture kind computation and is only needed to create the final upvar tuple ty. Doing so makes creation of UpvarCapture very cheap and expose further cleanup opportunity.
2022-01-07Remove span from UpvarCapture::ByValueGary Guo-1/+1
This span is unused and is superseded by capture_kind_expr_id in CaptureInfo
2022-01-07Update clippy for associated item changesMatthew Jasper-14/+16
2022-01-04Rollup merge of #91907 - lcnr:const-arg-infer, r=BoxyUwUMatthias Krüger-20/+50
Allow `_` as the length of array types and repeat expressions r? `@BoxyUwU` cc `@varkor`
2022-01-03Rollup merge of #90102 - nbdd0121:box3, r=jonas-schievinkMatthias Krüger-1/+0
Remove `NullOp::Box` Follow up of #89030 and MCP rust-lang/compiler-team#460. ~1 month later nothing seems to be broken, apart from a small regression that #89332 (1aac85bb716c09304b313d69d30d74fe7e8e1a8e) shows could be regained by remvoing the diverging path, so it shall be safe to continue and remove `NullOp::Box` completely. r? `@jonas-schievink` `@rustbot` label T-compiler
2021-12-31Make tidy check for magic numbers that spell thingsJosh Triplett-7/+7
Remove existing problematic cases.
2021-12-31Auto merge of #92252 - GuillaumeGomez:update-pulldown, r=camelid,xFrednetbors-5/+5
Update pulldown-cmark version to 0.9 Fixes https://github.com/rust-lang/rust/issues/92206. r? `@camelid`
2021-12-30Merge commit '0eff589afc83e21a03a168497bbab6b4dfbb4ef6' into clippyupflip1995-439/+1493
2021-12-28Update pulldown-cmark version in clippyGuillaume Gomez-5/+5
2021-12-23fix clippylcnr-20/+50
2021-12-22Bless clippy test.Mara Bos-1/+1
2021-12-19Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obkbors-75/+77
Remove `SymbolStr` This was originally proposed in https://github.com/rust-lang/rust/pull/74554#discussion_r466203544. As well as removing the icky `SymbolStr` type, it allows the removal of a lot of `&` and `*` occurrences. Best reviewed one commit at a time. r? `@oli-obk`
2021-12-17Auto merge of #89841 - cormacrelf:let-else-typed, r=nagisabors-31/+56
Implement let-else type annotations natively Tracking issue: #87335 Fixes #89688, fixes #89807, edit: fixes #89960 as well As explained in https://github.com/rust-lang/rust/issues/89688#issuecomment-940405082, the previous desugaring moved the let-else scrutinee into a dummy variable, which meant if you wanted to refer to it again in the else block, it had moved. This introduces a new hir type, ~~`hir::LetExpr`~~ `hir::Let`, which takes over all the fields of `hir::ExprKind::Let(...)` and adds an optional type annotation. The `hir::Let` is then treated like a `hir::Local` when type checking a function body, specifically: * `GatherLocalsVisitor` overrides a new `Visitor::visit_let_expr` and does pretty much exactly what it does for `visit_local`, assigning a local type to the `hir::Let` ~~(they could be deduplicated but they are right next to each other, so at least we know they're the same)~~ * It reuses the code in `check_decl_local` to typecheck the `hir::Let`, simply returning 'bool' for the expression type after doing that. * ~~`FnCtxt::check_expr_let` passes this local type in to `demand_scrutinee_type`, and then imitates check_decl_local's pattern checking~~ * ~~`demand_scrutinee_type` (the blindest change for me, please give this extra scrutiny) uses this local type instead of of creating a new one~~ * ~~Just realised the `check_expr_with_needs` was passing NoExpectation further down, need to pass the type there too. And apparently this Expectation API already exists.~~ Some other misc notes: * ~~Is the clippy code supposed to be autoformatted? I tried not to give huge diffs but maybe some rustfmt changes simply haven't hit it yet.~~ * in `rustc_ast_lowering/src/block.rs`, I noticed some existing `self.alias_attrs()` calls in `LoweringContext::lower_stmts` seem to be copying attributes from the lowered locals/etc to the statements. Is that right? I'm new at this, I don't know.
2021-12-17Merge commit '23d11428de3e973b34a5090a78d62887f821c90e' into clippyupflip1995-4446/+2856
2021-12-15Rollup merge of #90521 - jhpratt:stabilize-destructuring_assignment, ↵Matthias Krüger-13/+2
r=jackh726,pnkfelix Stabilize `destructuring_assignment` Closes #71126 - [Stabilization report](https://github.com/rust-lang/rust/issues/71126#issuecomment-941148058) - [Completed FCP](https://github.com/rust-lang/rust/issues/71126#issuecomment-954914819) `@rustbot` label +F-destructuring-assignment +T-lang Also needs +relnotes but I don't have permission to add that tag.
2021-12-15Remove unnecessary sigils around `Ident::as_str()` calls.Nicholas Nethercote-20/+20
2021-12-15Remove unnecessary sigils around `Symbol::as_str()` calls.Nicholas Nethercote-34/+34
2021-12-14Stabilize `destructuring_assignment`Jacob Pratt-13/+2
2021-12-15Remove `SymbolStr`.Nicholas Nethercote-21/+23
By changing `as_str()` to take `&self` instead of `self`, we can just return `&str`. We're still lying about lifetimes, but it's a smaller lie than before, where `SymbolStr` contained a (fake) `&'static str`!
2021-12-15Rollup merge of #91881 - Patrick-Poitras:stabilize-iter-zip, r=scottmcmMatthias Krüger-2/+0
Stabilize `iter::zip` Hello all! As the tracking issue (#83574) for `iter::zip` completed the final commenting period without any concerns being raised, I hereby submit this stabilization PR on the issue. As the pull request that introduced the feature (#82917) states, the `iter::zip` function is a shorter way to zip two iterators. As it's generally a quality-of-life/ergonomic improvement, it has been integrated into the codebase without any trouble, and has been used in many places across the rust compiler and standard library since March without any issues. For more details, I would refer to `@cuviper's` original PR, or the [function's documentation](https://doc.rust-lang.org/std/iter/fn.zip.html).
2021-12-15Rollup merge of #90939 - estebank:wg-af-polish, r=tmandryMatthias Krüger-80/+47
Tweak errors coming from `for`-loop, `?` and `.await` desugaring * Suggest removal of `.await` on non-`Future` expression * Keep track of obligations introduced by desugaring * Remove span pointing at method for obligation errors coming from desugaring * Point at called local sync `fn` and suggest making it `async` ``` error[E0277]: `()` is not a future --> $DIR/unnecessary-await.rs:9:10 | LL | boo().await; | -----^^^^^^ `()` is not a future | | | this call returns `()` | = help: the trait `Future` is not implemented for `()` help: do not `.await` the expression | LL - boo().await; LL + boo(); | help: alternatively, consider making `fn boo` asynchronous | LL | async fn boo () {} | +++++ ``` Fix #66731.
2021-12-14Remove iter::zip feature gate from clippyPFPoitras-2/+0
2021-12-14Auto merge of #91728 - Amanieu:stable_asm, r=joshtriplettbors-32/+33
Stabilize asm! and global_asm! Tracking issue: #72016 It's been almost 2 years since the original [RFC](https://github.com/rust-lang/rfcs/pull/2850) was posted and we're finally ready to stabilize this feature! The main changes in this PR are: - Removing `asm!` and `global_asm!` from the prelude as per the decision in #87228. - Stabilizing the `asm` and `global_asm` features. - Removing the unstable book pages for `asm` and `global_asm`. The contents are moved to the [reference](https://github.com/rust-lang/reference/pull/1105) and [rust by example](https://github.com/rust-lang/rust-by-example/pull/1483). - All links to these pages have been removed to satisfy the link checker. In a later PR these will be replaced with links to the reference or rust by example. - Removing the automatic suggestion for using `llvm_asm!` instead of `asm!` if you're still using the old syntax, since it doesn't work anymore with `asm!` no longer being in the prelude. This only affects code that predates the old LLVM-style `asm!` being renamed to `llvm_asm!`. - Updating `stdarch` and `compiler-builtins`. - Updating all the tests. r? `@joshtriplett`
2021-12-13fix clippy testsEsteban Kuber-12/+12
2021-12-13Fix rebase and clippy testsEsteban Kuber-55/+22
2021-12-13Fix clippy uses of QPath::LangItemEsteban Kuber-13/+13
2021-12-13let-else: use hir::Let in clippyCormac Relf-31/+56
fix clippy format using `cargo fmt -p clippy_{lints,utils}` manually revert rustfmt line truncations rename to hir::Let in clippy Undo the shadowing of various `expr` variables after renaming `scrutinee` reduce destructuring of hir::Let to avoid `expr` collisions cargo fmt -p clippy_{lints,utils} bless new clippy::author output
2021-12-13Fix clippy testsAmanieu d'Antras-32/+33
2021-12-12Auto merge of #91549 - fee1-dead:const_env, r=spastorinobors-2/+2
Eliminate ConstnessAnd again Closes #91489. Closes #89432. Reverts #91491. Reverts #89450. r? `@spastorino`
2021-12-12clippy owoEllen-12/+11
2021-12-12Revert "Auto merge of #91491 - spastorino:revert-91354, r=oli-obk"Deadbeef-2/+2
This reverts commit ff2439b7b9bafcfdff86b7847128014699df8442, reversing changes made to 2a9e0831d6603d87220cedd1b1293e2eb82ef55c.
2021-12-06Merge commit 'a5d597637dcb78dc73f93561ce474f23d4177c35' into clippyupflip1995-3243/+9876
2021-12-04Use IntoIterator for array impl everywhere.Mara Bos-2/+1
2021-12-03Add initial AST and MIR support for unwinding from inline assemblyAmanieu d'Antras-5/+3
2021-12-03Revert "Auto merge of #91354 - fee1-dead:const_env, r=spastorino"Santiago Pastorino-2/+2
This reverts commit 18bb8c61a975fff6424cda831ace5b0404277145, reversing changes made to d9baa361902b172be716f96619b909f340802dea.
2021-12-02Auto merge of #91354 - fee1-dead:const_env, r=spastorinobors-2/+2
Cleanup: Eliminate ConstnessAnd This is almost a behaviour-free change and purely a refactoring. "almost" because we appear to be using the wrong ParamEnv somewhere already, and this is now exposed by failing a test using the unstable `~const` feature. We most definitely need to review all `without_const` and at some point should probably get rid of many of them by using `TraitPredicate` instead of `TraitRef`. This is a continuation of https://github.com/rust-lang/rust/pull/90274. r? `@oli-obk` cc `@spastorino` `@ecstatic-morse`
2021-11-29Fix toolsDeadbeef-2/+2