summary refs log tree commit diff
path: root/src/tools/clippy
AgeCommit message (Collapse)AuthorLines
2022-11-01Run update lint toolMark Rousskov-5/+4
2022-11-01Lower lint level for READ_ZERO_BYTE_VECMark Rousskov-1/+1
This avoids reporting false-positives; see rust-lang/rust-clippy#9274 for details.
2022-10-27Revert "Do not consider method call receiver as an argument in AST."Michael Goulet-12/+12
This reverts commit 970184528718d7c10579cac7b7e7e66ef2e2a3f5.
2022-09-15Fix clippyest31-48/+45
2022-09-15Auto merge of #101811 - flip1995:clippyup, r=flip1995bors-3/+2
Clippy pre beta branch fix Before beta is branched on Friday, I want to move the `unused_peekable` lint that was added in this release cycle (1.65) to `nursery`. This lint was already reported twice (https://github.com/rust-lang/rust-clippy/issues/9456, https://github.com/rust-lang/rust-clippy/issues/9462) in a short time, so it is probably a good idea to fix it before it hits beta and then stable. r? `@Manishearth`
2022-09-14Temporarily move clippy::unused_peekable to nurseryPhilipp Krones-3/+2
2022-09-14Auto merge of #101212 - eholk:dyn-star, r=compiler-errorsbors-6/+9
Initial implementation of dyn* This PR adds extremely basic and incomplete support for [dyn*](https://smallcultfollowing.com/babysteps//blog/2022/03/29/dyn-can-we-make-dyn-sized/). The goal is to get something in tree behind a flag to make collaboration easier, and also to make sure the implementation so far is not unreasonable. This PR does quite a few things: * Introduce `dyn_star` feature flag * Adds parsing for `dyn* Trait` types * Defines `dyn* Trait` as a sized type * Adds support for explicit casts, like `42usize as dyn* Debug` * Including const evaluation of such casts * Adds codegen for drop glue so things are cleaned up properly when a `dyn* Trait` object goes out of scope * Adds codegen for method calls, at least for methods that take `&self` Quite a bit is still missing, but this gives us a starting point. Note that this is never intended to become stable surface syntax for Rust, but rather `dyn*` is planned to be used as an implementation detail for async functions in dyn traits. Joint work with `@nikomatsakis` and `@compiler-errors.` r? `@bjorn3`
2022-09-14Auto merge of #101709 - nnethercote:simplify-visitors-more, r=cjgillotbors-11/+11
Simplify visitors more A successor to #100392. r? `@cjgillot`
2022-09-13Address code review commentsEric Holk-197/+127
2022-09-13Auto merge of #100640 - reitermarkus:socket-display-buffer, r=thomccbors-28/+60
Use `DisplayBuffer` for socket addresses. Continuation of https://github.com/rust-lang/rust/pull/100625 for socket addresses. Renames `net::addr` to `net::addr::socket`, `net::ip` to `net::addr::ip` and `net::ip::display_buffer::IpDisplayBuffer` to `net::addr::display_buffer::DisplayBuffer`.
2022-09-12Make x.py check workEric Holk-131/+204
2022-09-12Simplify `clippy` fix.Markus Reiter-39/+22
2022-09-12Fix clippy.Markus Reiter-16/+65
2022-09-12Auto merge of #99334 - NiklasJonsson:84447/error-privacy, r=oli-obkbors-4/+3
rustc_error, rustc_private: Switch to stable hash containers Relates https://github.com/rust-lang/rust/issues/84447
2022-09-12Remove unused argument from `visit_poly_trait_ref`.Nicholas Nethercote-6/+6
2022-09-12Remove unused span argument from `visit_name`.Nicholas Nethercote-1/+1
2022-09-12Remove unused span argument from `walk_fn`.Nicholas Nethercote-4/+4
2022-09-10Auto merge of #98559 - jackh726:remove-reempty, r=oli-obkbors-1/+1
Remove ReEmpty r? rust-lang/types
2022-09-10rustc_error, rustc_private, rustc_ast: Switch to stable hash containersNiklas Jonsson-4/+3
2022-09-09Merge commit 'b52fb5234cd7c11ecfae51897a6f7fa52e8777fc' into clippyupPhilipp Krones-686/+15491
2022-09-09Appease clippy againMichael Goulet-10/+6
2022-09-09Make clippy happyMichael Goulet-2/+7
2022-09-08Remove ReEmptyJack Huey-1/+1
2022-09-08Auto merge of #101577 - Dylan-DPC:rollup-l9xw7i7, r=Dylan-DPCbors-209/+211
Rollup of 7 pull requests Successful merges: - #98933 (Opaque types' generic params do not imply anything about their hidden type's lifetimes) - #101041 (translations(rustc_session): migrates rustc_session to use SessionDiagnostic - Pt. 2) - #101424 (Adjust and slightly generalize operator error suggestion) - #101496 (Allow lower_lifetime_binder receive a closure) - #101501 (Allow lint passes to be bound by `TyCtxt`) - #101515 (Recover from typo where == is used in place of =) - #101545 (Remove unnecessary `PartialOrd` and `Ord`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-09-08Rollup merge of #101501 - Jarcho:tcx_lint_passes, r=davidtwcoDylan DPC-209/+211
Allow lint passes to be bound by `TyCtxt` This will allow storing things like `Ty<'tcx>` inside late lint passes. It's already possible to store various id types so they're already implicitly bound to a specific `TyCtxt`. r? rust-lang/compiler
2022-09-08Auto merge of #101467 - nnethercote:shrink-hir-Ty-Pat, r=spastorinobors-8/+16
Shrink `hir::Ty` and `hir::Pat` r? `@ghost`
2022-09-08Rollup merge of #101498 - petrochenkov:visparam, r=cjgillotDylan DPC-3/+3
rustc: Parameterize `ty::Visibility` over used ID It allows using `LocalDefId` instead of `DefId` when possible, and also encode cheaper `Visibility<DefIndex>` into metadata.
2022-09-08Introduce `DotDotPos`.Nicholas Nethercote-7/+15
This shrinks `hir::Pat` from 88 to 72 bytes.
2022-09-08Arena-allocate `hir::Lifetime`.Nicholas Nethercote-1/+1
This shrinks `hir::Ty` from 72 to 48 bytes. `visit_lifetime` is added to the HIR stats collector because these types are now stored in memory on their own, instead of being within other types.
2022-09-07Auto merge of #101432 - nnethercote:shrink-PredicateS, r=lcnrbors-5/+5
Shrink `PredicateS` r? `@ghost`
2022-09-07rustc: Parameterize `ty::Visibility` over used IDVadim Petrochenkov-3/+3
It allows using `LocalDefId` instead of `DefId` when possible, and also encode cheaper `Visibility<DefIndex>` into metadata.
2022-09-06Allow lint passes to be bound by `TyCtxt`Jason Newcomb-209/+211
2022-09-06Generalize the Assume intrinsic statement to a general Intrinsic statementOli Scherer-3/+7
2022-09-06Lower the assume intrinsic to a MIR statementOli Scherer-0/+3
2022-09-06Auto merge of #101241 - camsteffen:refactor-binding-annotations, r=cjgillotbors-103/+95
`BindingAnnotation` refactor * `ast::BindingMode` is deleted and replaced with `hir::BindingAnnotation` (which is moved to `ast`) * `BindingAnnotation` is changed from an enum to a tuple struct e.g. `BindingAnnotation(ByRef::No, Mutability::Mut)` * Associated constants added for convenience `BindingAnnotation::{NONE, REF, MUT, REF_MUT}` One goal is to make it more clear that `BindingAnnotation` merely represents syntax `ref mut` and not the actual binding mode. This was especially confusing since we had `ast::BindingMode`->`hir::BindingAnnotation`->`thir::BindingMode`. I wish there were more symmetry between `ByRef` and `Mutability` (variant) naming (maybe `Mutable::Yes`?), and I also don't love how long the name `BindingAnnotation` is, but this seems like the best compromise. Ideas welcome.
2022-09-05Auto merge of #101261 - TaKO8Ki:separate-receiver-from-arguments-in-hir, ↵bors-586/+677
r=cjgillot Separate the receiver from arguments in HIR Related to #100232 cc `@cjgillot`
2022-09-05use `propagate_through_exprs` instead of `propagate_through_expr`Takayuki Maeda-6/+2
fix `ExprKind` static_assert_size fix hir-stats
2022-09-05Auto merge of #101228 - nnethercote:simplify-hir-PathSegment, r=petrochenkovbors-4/+3
Simplify `hir::PathSegment` r? `@petrochenkov`
2022-09-05refactor: remove unnecessary variablesTakayuki Maeda-76/+67
2022-09-05separate the receiver from arguments in HIR under /clippyTakayuki Maeda-558/+662
2022-09-05Rollup merge of #101142 - nnethercote:improve-hir-stats, r=davidtwcoDylan DPC-6/+6
Improve HIR stats #100398 improve the AST stats collection done by `-Zhir-stats`. This PR does the same for HIR stats collection. r? `@davidtwco`
2022-09-05Pack `Term` in the same way as `GenericArg`.Nicholas Nethercote-5/+5
This shrinks the `PredicateS` type, which is instanted frequently.
2022-09-05Make `hir::PathSegment::res` non-optional.Nicholas Nethercote-4/+3
2022-09-02clippy: BindingAnnotation changeCameron Steffen-103/+95
2022-08-31Auto merge of #101249 - matthiaskrgr:rollup-wahnoz8, r=matthiaskrgrbors-3973/+9254
Rollup of 10 pull requests Successful merges: - #100787 (Pretty printing give proper error message without panic) - #100838 (Suggest moving redundant generic args of an assoc fn to its trait) - #100844 (migrate rustc_query_system to use SessionDiagnostic) - #101140 (Update Clippy) - #101161 (Fix uintended diagnostic caused by `drain(..)`) - #101165 (Use more `into_iter` rather than `drain(..)`) - #101229 (Link “? operator” to relevant chapter in The Book) - #101230 (lint: avoid linting diag functions with diag lints) - #101236 (Avoid needless buffer zeroing in `std::sys::windows::fs`) - #101240 (Fix a typo on `wasm64-unknown-unknown` doc) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-08-31Use `CountIsStart` in clippyJason Newcomb-3/+3
2022-08-31Merge commit 'f51aade56f93175dde89177a92e3669ebd8e7592' into clippyupJason Newcomb-3973/+9254
2022-08-31fix a clippy testRalf Jung-1/+1
2022-08-30Auto merge of #98919 - 5225225:stricter-invalid-value, r=RalfJungbors-1/+1
Strengthen invalid_value lint to forbid uninit primitives, adjust docs to say that's UB For context: https://github.com/rust-lang/rust/issues/66151#issuecomment-1174477404= This does not make it a FCW, but it does explicitly state in the docs that uninit integers are UB. This also doesn't affect any runtime behavior, uninit u32's will still successfully be created through mem::uninitialized.
2022-08-29Fix tests due to stricter invalid_value5225225-1/+1