about summary refs log tree commit diff
path: root/src/tools/clippy/clippy_utils
AgeCommit message (Collapse)AuthorLines
2021-03-26Use iter::zip in src/tools/clippy/Josh Stone-7/+10
2021-03-25Merge commit '0e87918536b9833bbc6c683d1f9d51ee2bf03ef1' into clippyupflip1995-762/+919
2021-03-23Add has_default to GenericParamDefKind::Constkadmin-4/+4
This currently creates a field which is always false on GenericParamDefKind for future use when consts are permitted to have defaults Update const_generics:default locations Previously just ignored them, now actually do something about them. Fix using type check instead of value Add parsing This adds all the necessary changes to lower const-generics defaults from parsing. Change P<Expr> to AnonConst This matches the arguments passed to instantiations of const generics, and makes it specific to just anonymous constants. Attempt to fix lowering bugs
2021-03-22Auto merge of #79278 - mark-i-m:stabilize-or-pattern, r=nikomatsakisbors-1/+1
Stabilize or_patterns (RFC 2535, 2530, 2175) closes #54883 This PR stabilizes the or_patterns feature in Rust 1.53. This is blocked on the following (in order): - [x] The crater run in https://github.com/rust-lang/rust/pull/78935#issuecomment-731564021 - [x] The resolution of the unresolved questions and a second crater run (https://github.com/rust-lang/rust/pull/78935#issuecomment-735412705) - It looks like we will need to pursue some sort of edition-based transition for `:pat`. - [x] Nomination and discussion by T-lang - [x] Implement new behavior for `:pat` based on consensus (https://github.com/rust-lang/rust/pull/80100). - [ ] An FCP on stabilization EDIT: Stabilization report is in https://github.com/rust-lang/rust/pull/79278#issuecomment-772815177
2021-03-20update `const_eval_resolve`lcnr-3/+5
2021-03-19clippy: stabilize or_patterns lintmark-1/+1
2021-03-18hir: Preserve used syntax in `TyKind::TraitObject`Vadim Petrochenkov-1/+1
2021-03-17Auto merge of #83188 - petrochenkov:field, r=lcnrbors-10/+12
ast/hir: Rename field-related structures I always forget what `ast::Field` and `ast::StructField` mean despite working with AST for long time, so this PR changes the naming to less confusing and more consistent. - `StructField` -> `FieldDef` ("field definition") - `Field` -> `ExprField` ("expression field", not "field expression") - `FieldPat` -> `PatField` ("pattern field", not "field pattern") Various visiting and other methods working with the fields are renamed correspondingly too. The second commit reduces the size of `ExprKind` by boxing fields of `ExprKind::Struct` in preparation for https://github.com/rust-lang/rust/pull/80080.
2021-03-16ast: Reduce size of `ExprKind` by boxing fields of `ExprKind::Struct`Vadim Petrochenkov-2/+4
2021-03-16ast/hir: Rename field-related structuresVadim Petrochenkov-8/+8
StructField -> FieldDef ("field definition") Field -> ExprField ("expression field", not "field expression") FieldPat -> PatField ("pattern field", not "field pattern") Also rename visiting and other methods working on them.
2021-03-15Add comments with examples and testsRoxane-1/+1
2021-03-14Add fake_read() to clippyRoxane-0/+3
2021-03-12Merge commit '6ed6f1e6a1a8f414ba7e6d9b8222e7e5a1686e42' into clippyupflip1995-42/+268
2021-03-10Auto merge of #79519 - cjgillot:noattr, r=wesleywiserbors-3/+3
Store HIR attributes in a side table Same idea as #72015 but for attributes. The objective is to reduce incr-comp invalidations due to modified attributes. Notably, those due to modified doc comments. Implementation: - collect attributes during AST->HIR lowering, in `LocalDefId -> ItemLocalId -> &[Attributes]` nested tables; - access the attributes through a `hir_owner_attrs` query; - local refactorings to use this access; - remove `attrs` from HIR data structures one-by-one. Change in behaviour: - the HIR visitor traverses all attributes at once instead of parent-by-parent; - attribute arrays are sometimes duplicated: for statements and variant constructors; - as a consequence, attributes are marked as used after unused-attribute lint emission to avoid duplicate lints. ~~Current bug: the lint level is not correctly applied in `std::backtrace_rs`, triggering an unused attribute warning on `#![no_std]`. I welcome suggestions.~~
2021-03-09Remove hir::Crate::attrs.Camille GILLOT-3/+3
2021-03-09Switch to changing cp_non_overlap in tformkadmin-1/+1
It was suggested to lower this in MIR instead of ssa, so do that instead.
2021-03-09Update craneliftkadmin-2/+2
2021-03-09Update match brancheskadmin-1/+8
This updates all places where match branches check on StatementKind or UseContext. This doesn't properly implement them, but adds TODOs where they are, and also adds some best guesses to what they should be in some cases.
2021-03-05Shrink the size of Rvalue by 16 bytesOli Scherer-1/+1
2021-03-01Use diagnostic items in into_iter_collectionsCameron Steffen-22/+20
2021-02-26Add missing diagnostic item SymbolsCameron Steffen-1/+2
2021-02-25Merge commit '928e72dd10749875cbd412f74bfbfd7765dbcd8a' into clippyupflip1995-0/+6799