about summary refs log tree commit diff
path: root/src/tools/clippy
AgeCommit message (Collapse)AuthorLines
2023-10-03Point to full async fn for futureMichael Goulet-19/+22
2023-10-02subtyping_projectionsouz-a-0/+1
2023-10-01Auto merge of #115670 - Zoxc:outline-panic-macro-1, r=Mark-Simulacrumbors-23/+52
Partially outline code inside the panic! macro This outlines code inside the panic! macro in some cases. This is split out from https://github.com/rust-lang/rust/pull/115562 to exclude changes to rustc.
2023-09-30Auto merge of #116254 - WaffleLapkin:nicen-traversal, r=cjgillotbors-13/+19
Assorted improvements for `rustc_middle::mir::traversal` r? `@cjgillot` I'm not _entirely_ sure about all changes, although I do like all of them. If you'd like I can drop some commits. Best reviewed on a commit-by-commit basis, I think, since they are fairly isolated.
2023-09-29Rollup merge of #116245 - flip1995:clippy-backport, r=ManishearthMatthias Krüger-1/+1
Clippy backport: Move needless_raw_string_hashes to pedantic Really small backport this time. Context: https://github.com/rust-lang/rust-clippy/pull/11415#issuecomment-1739880932 I'd rather get this in 1.74 than waiting another release cycle. r? `@Manishearth` cc `@Mark-Simulacrum` This should be merged before beta is branched tomorrow.
2023-09-28Reverse postorder instead of using reversed postorderMaybe Waffle-13/+19
2023-09-28Remove `rustc_lint_defs::lint_array`DaniPopes-2/+2
2023-09-28Move needless_raw_string_hashes to pedanticAlex Macleod-1/+1
2023-09-27Auto merge of #116163 - compiler-errors:lazyness, r=oli-obkbors-3/+3
Don't store lazyness in `DefKind::TyAlias` 1. Don't store lazyness of a type alias in its `DefKind`, but instead via a query. 2. This allows us to treat type aliases as lazy if `#[feature(lazy_type_alias)]` *OR* if the alias contains a TAIT, rather than having checks for both in separate parts of the codebase. r? `@oli-obk` cc `@fmease`
2023-09-26Auto merge of #116144 - lcnr:subst-less, r=oli-obkbors-2/+2
subst -> instantiate continues #110793, there are still quite a few uses of `subst` and `substitute`, but changing them all in the same PR was a bit too much, so I've stopped here for now.
2023-09-26subst -> instantiatelcnr-2/+2
2023-09-26Don't store lazyness in DefKindMichael Goulet-3/+3
2023-09-25Merge commit '7671c283a50b5d1168841f3014b14000f01dd204' into clippyupPhilipp Krones-2312/+3995
2023-09-23Remove GeneratorWitness and rename GeneratorWitnessMIR.Camille GILLOT-1/+0
2023-09-23Bless clippy.Camille GILLOT-166/+87
2023-09-23Enable drop_tracking_mir by default.Camille GILLOT-18/+25
2023-09-23Auto merge of #116052 - oli-obk:ceci_nest_pas_une_query, r=WaffleLapkinbors-1/+1
Add a way to decouple the implementation and the declaration of a TyCtxt method. properly addresses https://github.com/rust-lang/rust/pull/115819 accepted MCP: https://github.com/rust-lang/compiler-team/issues/395
2023-09-22Auto merge of #115696 - RalfJung:closure-ty-print, r=oli-obkbors-3/+3
adjust how closure/generator types are printed I saw `&[closure@$DIR/issue-20862.rs:2:5]` and I thought it is a slice type, because that's usually what `&[_]` is... it took me a while to realize that this is just a confusing printer and actually there's no slice. Let's use something that cannot be mistaken for a regular type.
2023-09-22Add a way to decouple the implementation and the declaration of a TyCtxt method.Oli Scherer-1/+1
2023-09-22Auto merge of #114776 - fee1-dead-contrib:enable-effects-in-libcore, r=oli-obkbors-2/+3
Enable effects for libcore ~~r? `@oli-obk~~` forgot you are on vacation, oops
2023-09-22fix clippy errors (ignore effects in certainty)Deadbeef-2/+3
2023-09-21adjust how closure/generator types and rvalues are printedRalf Jung-3/+3
2023-09-21Record asyncness span in HIRMichael Goulet-6/+7
2023-09-21Rollup merge of #115972 - RalfJung:const-consistency, r=oli-obkGuillaume Gomez-16/+16
rename mir::Constant -> mir::ConstOperand, mir::ConstKind -> mir::Const Also, be more consistent with the `to/eval_bits` methods... we had some that take a type and some that take a size, and then sometimes the one that takes a type is called `bits_for_ty`. Turns out that `ty::Const`/`mir::ConstKind` carry their type with them, so we don't need to even pass the type to those `eval_bits` functions at all. However this is not properly consistent yet: in `ty` we have most of the methods on `ty::Const`, but in `mir` we have them on `mir::ConstKind`. And indeed those two types are the ones that correspond to each other. So `mir::ConstantKind` should actually be renamed to `mir::Const`. But what to do with `mir::Constant`? It carries around a span, that's really more like a constant operand that appears as a MIR operand... it's more suited for `syntax.rs` than `consts.rs`, but the bigger question is, which name should it get if we want to align the `mir` and `ty` types? `ConstOperand`? `ConstOp`? `Literal`? It's not a literal but it has a field called `literal` so it would at least be consistently wrong-ish... ``@oli-obk`` any ideas?
2023-09-21Prevent promotion of const fn calls in inline constsOli Scherer-2/+2
2023-09-21rename mir::Constant -> mir::ConstOperand, mir::ConstKind -> mir::ConstRalf Jung-16/+16
2023-09-19move ConstValue into mirRalf Jung-2/+2
this way we have mir::ConstValue and ty::ValTree as reasonably parallel
2023-09-18Auto merge of #115748 - RalfJung:post-mono, r=oli-obkbors-5/+5
move required_consts check to general post-mono-check function This factors some code that is common between the interpreter and the codegen backends into shared helper functions. Also as a side-effect the interpreter now uses the same `eval` functions as everyone else to get the evaluated MIR constants. Also this is in preparation for another post-mono check that will be needed for (the current hackfix for) https://github.com/rust-lang/rust/issues/115709: ensuring that all locals are dynamically sized. I didn't expect this to change diagnostics, but it's just cycle errors that change. r? `@oli-obk`
2023-09-17Rollup merge of #115477 - kellerkindt:stabilized_int_impl, r=dtolnayDylan DPC-1/+1
Stabilize the `Saturating` type Closes #87920 Closes #92354 Stabilization report https://github.com/rust-lang/rust/issues/87920#issuecomment-1652346124 FCP https://github.com/rust-lang/rust/issues/87920#issuecomment-1676438885
2023-09-15Auto merge of #115851 - Alexendoo:clippy-doc-hidden-headers, r=flip1995bors-1/+20
Ignore `#[doc(hidden)]` functions in clippy doc lints Fixes https://github.com/rust-lang/rust-clippy/issues/11501 The implementation before #115689 had a check for unsugared doc comments that also happened to catch `#[doc(hidden)]`, this adds the check back in more explicitly https://github.com/rust-lang/rust/blob/852bf4e51bf260550cd1a280d2146f1c0641b1e8/src/tools/clippy/clippy_lints/src/doc.rs#L526-L529 r? `@flip1995`
2023-09-14don't point at const usage site for resolution-time errorsRalf Jung-2/+2
also share the code that emits the actual error
2023-09-14move required_consts check to general post-mono-check functionRalf Jung-3/+3
2023-09-14Auto merge of #115677 - matthewjasper:let-expr-recovery, r=b-naberbors-3/+3
Improve invalid let expression handling - Move all of the checks for valid let expression positions to parsing. - Add a field to ExprKind::Let in AST/HIR to mark whether it's in a valid location. - Suppress some later errors and MIR construction for invalid let expressions. - Fix a (drop) scope issue that was also responsible for #104172. Fixes #104172 Fixes #104868
2023-09-14Ignore `#[doc(hidden)]` functions in clippy doc lintsAlex Macleod-1/+20
2023-09-14Auto merge of #115817 - fee1-dead-contrib:fix-codegen, r=oli-obkbors-1/+1
treat host effect params as erased in codegen This fixes the changes brought to codegen tests when effect params are added to libcore, by not attempting to monomorphize functions that get the host param by being `const fn`. r? `@oli-obk`
2023-09-14fix clippy (and MIR printing) handling of ConstValue::Indirect slicesRalf Jung-13/+4
2023-09-14treat host effect params as erased generics in codegenDeadbeef-1/+1
This fixes the changes brought to codegen tests when effect params are added to libcore, by not attempting to monomorphize functions that get the host param by being `const fn`.
2023-09-14cleanup op_to_const a bit; rename ConstValue::ByRef → IndirectRalf Jung-2/+2
2023-09-14use AllocId instead of Allocation in ConstValue::ByRefRalf Jung-25/+28
2023-09-13Auto merge of #115790 - flip1995:clippyup, r=Manishearthbors-1635/+4682
Update Clippy r? `@Manishearth`
2023-09-13make the set of methods between our two Const types more consistentRalf Jung-10/+2
2023-09-12Merge commit '98363cbf6a7c3f8b571a7d92a3c645bb4376e4a6' into clippyupPhilipp Krones-1635/+4682
2023-09-12Auto merge of #115689 - Alexendoo:clippy-doc-comments, ↵bors-157/+160
r=notriddle,Manishearth,flip1995 Reuse rustdoc's doc comment handling in Clippy Moves `source_span_for_markdown_range` and `span_of_attrs` (renamed to `span_of_fragments`) to `rustc_resolve::rustdoc` so it can be used in Clippy Fixes https://github.com/rust-lang/rust-clippy/issues/10277 Fixes https://github.com/rust-lang/rust-clippy/issues/5593 Fixes https://github.com/rust-lang/rust-clippy/issues/10263 Fixes https://github.com/rust-lang/rust-clippy/issues/2581
2023-09-11Update tools and fulldeps testsMatthew Jasper-3/+3
2023-09-10Call `LateLintPass::check_attribute` from `with_lint_attrs`Alex Macleod-7/+21
2023-09-08Reuse rustdoc's doc comment handling in ClippyAlex Macleod-157/+160
2023-09-08Partially outline code inside the panic! macroJohn Kåre Alsaker-23/+52
2023-09-07Use `Freeze` for `SourceFile.lines`John Kåre Alsaker-47/+39
2023-09-05Auto merge of #115507 - cjgillot:relative-source-file, r=oli-obkbors-19/+15
Use relative positions inside a SourceFile. This allows to remove the normalization of start positions for hashing, and simplify allocation of global address space. cc `@Zoxc`
2023-09-04Adjust clippy tests with new rustc help suggestion for lintsUrgau-0/+838