about summary refs log tree commit diff
path: root/compiler/rustc_lint/src
AgeCommit message (Collapse)AuthorLines
2022-12-09Account for macros in const genericsEsteban Küber-0/+1
2022-12-09Rollup merge of #102406 - mejrs:missing_copy, r=wesleywiserMatthias Krüger-1/+31
Make `missing_copy_implementations` more cautious - Fixes https://github.com/rust-lang/rust/issues/98348 - Also makes the lint not fire on large types and types containing raw pointers. Thoughts?
2022-12-09Don't warn about unused parens when they are used by yeet exprMaybe Waffle-1/+4
2022-12-09Implement allow-by-default multiple_supertrait_upcastable lintGary Guo-0/+66
2022-12-07Rollup merge of #105267 - compiler-errors:issue-104613, r=oli-obkMatthias Krüger-1/+1
Don't ICE in ExprUseVisitor on FRU for non-existent struct Fixes #104613 Fixes #105202
2022-12-07Split `EarlyContextAndPasses::check_id` in two.Nicholas Nethercote-2/+9
2022-12-07Inline some hot lint pass functions.Nicholas Nethercote-0/+6
These each have a single call site, due to being called from a "combined" lint pass.
2022-12-07Rename `$passes` as `$pass` in several macros.Nicholas Nethercote-14/+14
Because it makes more sense that way.
2022-12-07Add some useful comments.Nicholas Nethercote-1/+12
2022-12-07Remove `$hir` argument from `late_lint_methods!`.Nicholas Nethercote-42/+40
Because it's always `'tcx`.
2022-12-07Auto merge of #105291 - nnethercote:remove-LintPassObjects, r=cjgillotbors-100/+51
Remove `{Early,Late}LintPassObjects`. `EarlyContextAndPass` wraps a single early lint pass. We aggregate multiple passes into that single pass by using `EarlyLintPassObjects`. This commit removes `EarlyLintPassObjects` by changing `EarlyContextAndPass` into `EarlyContextAndPasses`. I.e. it just removes a level of indirection. This makes the code simpler and slightly faster. The commit does likewise for late lints. r? `@cjgillot`
2022-12-06Rollup merge of #105004 - TaKO8Ki:fix-104897, r=wesleywiserMatthias Krüger-5/+26
Fix `emit_unused_delims_expr` ICE Fixes #104897 This is also related to #104433.
2022-12-06Rollup merge of #104898 - oli-obk:group_all_the_things, r=wesleywiserMatthias Krüger-1/+1
Put all cached values into a central struct instead of just the stable hash cc `@nnethercote` this allows re-use of the type for Predicate without duplicating all the logic for the non-hash cached fields
2022-12-05Remove `{Early,Late}LintPassObjects`.Nicholas Nethercote-100/+51
`EarlyContextAndPass` wraps a single early lint pass. We aggregate multiple passes into that single pass by using `EarlyLintPassObjects`. This commit removes `EarlyLintPassObjects` by changing `EarlyContextAndPass` into `EarlyContextAndPasses`. I.e. it just removes a level of indirection. This makes the code simpler and slightly faster. The commit does likewise for late lints.
2022-12-04drive-by: move field_index to typeck resultsMichael Goulet-1/+1
2022-12-02Auto merge of #104863 - nnethercote:reduce-lint-macros, r=cjgillotbors-336/+157
Reduce macro usage for lints r? `@cjgillot`
2022-12-02return when expr has errorTakayuki Maeda-5/+26
fmt add a comment
2022-12-02Inline and remove `early_lint_node`.Nicholas Nethercote-35/+12
It has a single call site.
2022-12-02Merge `builtins` into `EarlyLintPassObjects`.Nicholas Nethercote-15/+4
This avoids calling `early_lint_node` twice. Note: one `early_lint_node` call had `!pre_expansion` for the second argument and the other had `false`. The new single call just has `!pre_expansion`. This results in a reduction of duplicate error messages in some `ui-fulldeps` tests. The order of some `ui-fulldeps` output also changes, but that doesn't matter.
2022-12-02Remove some unnecessary `Send` bounds.Nicholas Nethercote-3/+2
Required to get the parallel compiler building again.
2022-12-02Inline and remove `late_lint_pass_crate`.Nicholas Nethercote-14/+9
It has a single call site.
2022-12-02Inline and remove `late_lint_mod_pass`.Nicholas Nethercote-17/+8
It has a single call site.
2022-12-02Merge `builtins` into `LateLintPassObjects`.Nicholas Nethercote-13/+7
This avoids calling the `late_lint_{mod_pass,pass_crate}` twice.
2022-12-02Remove six macros relating to lint definitions.Nicholas Nethercote-119/+103
These were enabled by the removal of `-Zno-interleave-lints`.
2022-12-02Remove `-Zno-interleave-lints`.Nicholas Nethercote-108/+24
Because it complicates lint implementation greatly.
2022-12-02Eliminate four unnecessary lint macros.Nicholas Nethercote-40/+16
The lint definitions use macros heavily. This commit merges some of them that are split unnecessarily. I find the reduced indirection makes it easier to imagine what the generated code will look like.
2022-12-01rustc_ast_lowering: Stop lowering imports into multiple itemsVadim Petrochenkov-1/+1
Lower them into a single item with multiple resolutions instead. This also allows to remove additional `NodId`s and `DefId`s related to those additional items.
2022-12-01rustc_hir: Relax lifetime requirements on `Visitor::visit_path`Vadim Petrochenkov-3/+3
2022-11-30Update documentationOli Scherer-1/+1
2022-11-29Rebasemejrs-7/+2
2022-11-29Update trait checkmejrs-4/+7
2022-11-29Make `missing_copy_implementations` more cautiousmejrs-1/+33
2022-11-29Make inferred_outlives_crate return ClauseSantiago Pastorino-12/+8
2022-11-29Rollup merge of #104951 - Swatinem:async-kind, r=compiler-errorsMatthias Krüger-4/+1
Simplify checking for `GeneratorKind::Async` Adds a helper method around `generator_kind` that makes matching async constructs simpler.
2022-11-28Simplify checking for `GeneratorKind::Async`Arpad Borsos-4/+1
Adds a helper method around `generator_kind` that makes matching async constructs simpler.
2022-11-28Rename `NestedMetaItem::[Ll]iteral` as `NestedMetaItem::[Ll]it`.Nicholas Nethercote-2/+2
We already use a mix of `Literal` and `Lit`. The latter is better because it is shorter without causing any ambiguity.
2022-11-27Rollup merge of #104976 - WaffleLapkin:move_comments, r=cjgillotMatthias Krüger-1/+1
Prefer doc comments over `//`-comments in compiler Doc comments are generally nicer: they show up in the documentation, they are shown in IDEs when you hover other mentions of items, etc. Thus it makes sense to use them instead of `//`-comments.
2022-11-27Auto merge of #104048 - cjgillot:split-lifetime, r=compiler-errorsbors-6/+2
Separate lifetime ident from lifetime resolution in HIR Drive-by: change how suggested generic args are computed. Fixes https://github.com/rust-lang/rust/issues/103815 I recommend reviewing commit-by-commit.
2022-11-27Prefer doc comments over `//`-comments in compilerMaybe Waffle-1/+1
2022-11-27Auto merge of #103917 - oli-obk:layout_math, r=RalfJung,lcnrbors-63/+97
Various cleanups around scalar layout restrictions Pulled out of https://github.com/rust-lang/rust/pull/103724
2022-11-26Rollup merge of #104786 - WaffleLapkin:amp-mut-help, r=compiler-errorsGuillaume Gomez-2/+2
Use the power of adding helper function to simplify code w/ `Mutability` r? `@compiler-errors`
2022-11-25Use "must be init" instead of "must not be uninit" everywhereOli Scherer-5/+3
2022-11-25Add a `because` to errors derived from fieldsOli Scherer-22/+21
2022-11-25Don't show fields from other cratesOli Scherer-1/+3
2022-11-25Reinstate the previous compact form of "in this field" errorsOli Scherer-4/+12
2022-11-25Don't try to compute the layout of generic types.Oli Scherer-23/+23
2022-11-25Compute layout instead of manually procesisng the layout restriction attributesOli Scherer-31/+36
2022-11-25Print a trace through types to show how to get to the problematic typeOli Scherer-42/+64
2022-11-25Introduce PredicateKind::ClauseSantiago Pastorino-18/+26
2022-11-24Auto merge of #104845 - matthiaskrgr:rollup-tckj956, r=matthiaskrgrbors-0/+1
Rollup of 11 pull requests Successful merges: - #104514 (Use node_ty_opt to avoid ICE in visit_ty) - #104704 (Allow power10-vector feature in PowerPC) - #104747 (resolve: Don't use constructor def ids in the map for field names) - #104773 (OpaqueCast projections are always overlapping, they can't possibly be disjoint) - #104774 (Document split{_ascii,}_whitespace() for empty strings) - #104780 (make `error_reported` check for delayed bugs) - #104782 (Bump the const eval step limit) - #104792 (rustdoc: simplify `.search-results-title` CSS) - #104796 (lint: do not warn unused parens around higher-ranked function pointers) - #104820 (Remove normalize_projection_type) - #104822 (with_query_mode -> new) Failed merges: - #104716 (move 2 candidates into builtin candidate) - #104841 (Assert that we don't capture escaping bound vars in `Fn` trait selection) r? `@ghost` `@rustbot` modify labels: rollup