about summary refs log tree commit diff
path: root/clippy_lints/src/utils
AgeCommit message (Collapse)AuthorLines
2022-02-10Merge commit '57b3c4b90f4346b3990c1be387c3b3ca7b78412c' into clippyupflip1995-8/+26
2022-02-03Remove defaultness from ImplItem.Camille GILLOT-3/+0
2022-01-27Merge commit 'a98e7ab8b94485be6bd03e0c6b8682ecab5b52e6' into clippyupflip1995-4/+9
2022-01-23rustc_lint: Reuse the set of registered tools from resolverVadim Petrochenkov-1/+1
2022-01-21Remove a span from hir::ExprKind::MethodCallCameron Steffen-7/+7
2022-01-17Auto merge of #90986 - camsteffen:nested-filter, r=cjgillotbors-15/+13
Replace `NestedVisitorMap` with generic `NestedFilter` This is an attempt to make the `intravisit::Visitor` API simpler and "more const" with regard to nested visiting. With this change, `intravisit::Visitor` does not visit nested things by default, unless you specify `type NestedFilter = nested_filter::OnlyBodies` (or `All`). `nested_visit_map` returns `Self::Map` instead of `NestedVisitorMap<Self::Map>`. It panics by default (unreachable if `type NestedFilter` is omitted). One somewhat trixty thing here is that `nested_filter::{OnlyBodies, All}` live in `rustc_middle` so that they may have `type Map = map::Map` and so that `impl Visitor`s never need to specify `type Map` - it has a default of `Self::NestedFilter::Map`.
2022-01-17Auto merge of #92816 - tmiasko:rm-llvm-asm, r=Amanieubors-17/+0
Remove deprecated LLVM-style inline assembly The `llvm_asm!` was deprecated back in #87590 1.56.0, with intention to remove it once `asm!` was stabilized, which already happened in #91728 1.59.0. Now it is time to remove `llvm_asm!` to avoid continued maintenance cost. Closes #70173. Closes #92794. Closes #87612. Closes #82065. cc `@rust-lang/wg-inline-asm` r? `@Amanieu`
2022-01-16Fix Visitor::NestedFilter in ClippyCameron Steffen-15/+13
2022-01-13Merge commit '97a5daa65908e59744e2bc625b14849352231c75' into clippyupflip1995-20/+43
2022-01-12Remove LLVM-style inline assembly from clippyTomasz Miąsko-17/+0
2022-01-09rustc_metadata: Rename `item_children(_untracked)` to ↵Vadim Petrochenkov-2/+2
`module_children(_untracked)` And `each_child_of_item` to `for_each_module_child`
2022-01-04Rollup merge of #91907 - lcnr:const-arg-infer, r=BoxyUwUMatthias Krüger-4/+16
Allow `_` as the length of array types and repeat expressions r? `@BoxyUwU` cc `@varkor`
2021-12-30Merge commit '0eff589afc83e21a03a168497bbab6b4dfbb4ef6' into clippyupflip1995-11/+9
2021-12-23fix clippylcnr-4/+16
2021-12-17Auto merge of #89841 - cormacrelf:let-else-typed, r=nagisabors-7/+17
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-13/+8
2021-12-13Fix clippy uses of QPath::LangItemEsteban Kuber-1/+1
2021-12-13let-else: use hir::Let in clippyCormac Relf-7/+17
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-06Merge commit 'a5d597637dcb78dc73f93561ce474f23d4177c35' into clippyupflip1995-612/+672
2021-11-04Merge commit 'e18101137866b79045fee0ef996e696e68c920b4' into clippyupflip1995-3/+14
2021-10-21Merge commit '91496c2ac6abf6454c413bb23e8becf6b6dc20ea' into clippyupflip1995-3/+10
2021-10-07Merge commit 'b7f3f7f6082679da2da9a0b3faf1b5adef3afd3b' into clippyupflip1995-6/+10
2021-10-02Make diangostic item names consistentCameron Steffen-1/+1
2021-09-28Merge commit 'cb7915b00c235e9b5861564f3be78dba330980ee' into clippyupflip1995-7/+19
2021-09-08Merge commit '27afd6ade4bb1123a8bf82001629b69d23d62aff' into clippyupflip1995-28/+14
2021-08-28Teach tools that macros are now HIR itemsinquisitivecrystal-0/+7
2021-08-22Fix typos “a”→“an”Frank Steffahn-1/+1
2021-08-15Introduce hir::ExprKind::Let - Take 2Caio-29/+13
2021-08-12Merge commit '7bfc26ec8e7a454786668e7e52ffe527fc649735' into clippyupflip1995-36/+107
2021-07-29Merge commit '0cce3f643bfcbb92d5a1bb71858c9cbaff749d6b' into clippyupflip1995-120/+124
2021-07-15Merge commit '54a20a02ecd0e1352a871aa0990bcc8b8b03173e' into clippyupflip1995-9/+11
2021-07-01Merge commit '61eb38aeda6cb54b93b872bf503d70084c4d621c' into clippyupflip1995-14/+50
2021-06-03Merge commit '3ae8faff4d46ad92f194c2a4b941c3152a701b31' into clippyupflip1995-20/+20
2021-05-20Merge commit '9e3cd88718cd1912a515d26dbd9c4019fd5a9577' into clippyupflip1995-37/+278
2021-05-06Merge commit 'b71f3405606d49b9735606b479c3415a0ca9810f' into clippyupflip1995-152/+739
2021-04-27Merge commit '7c7683c8efe447b251d6c5ca6cce51233060f6e8' into clippyupflip1995-1/+1
2021-04-22Merge commit '98e2b9f25b6db4b2680a3d388456d9f95cb28344' into clippyupflip1995-7/+7
2021-04-08Merge commit 'b40ea209e7f14c8193ddfc98143967b6a2f4f5c9' into clippyupflip1995-111/+278
2021-04-06Use AnonConst for asm! constantsAmanieu d'Antras-1/+4
2021-03-25Merge commit '0e87918536b9833bbc6c683d1f9d51ee2bf03ef1' into clippyupflip1995-8/+6
2021-03-16ast/hir: Rename field-related structuresVadim Petrochenkov-4/+4
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-09Remove hir::Expr::attrs.Camille GILLOT-1/+1
2021-03-09Remove hir::Item::attrs.Camille GILLOT-1/+1
2021-03-09Remove hir::ImplItem::attrs.Camille GILLOT-1/+1
2021-03-09Remove hir::Arm::attrs.Camille GILLOT-1/+1
2021-03-09Remove hir::StmtKind::attrs.Camille GILLOT-1/+1
2021-03-09Simplify clippy author.Camille GILLOT-13/+13
2021-02-25Merge commit '928e72dd10749875cbd412f74bfbfd7765dbcd8a' into clippyupflip1995-6127/+13
2021-02-18ast: Keep expansion status for out-of-line module itemsVadim Petrochenkov-3/+6
Also remove `ast::Mod` which is mostly redundant now
2021-02-17Auto merge of #81993 - flip1995:clippyup, r=Manishearthbors-75/+86
Update Clippy Biweekly Clippy update r? `@Manishearth`