Commit Graph

1011 Commits

Author SHA1 Message Date
unexge
682d52cf7c Update assertion macro parsing logic for Rust 1.52 changes
Co-authored-by: Weihang Lo <me@weihanglo.tw>
2023-03-08 08:51:52 +00:00
unexge
b4b2b1235a Revert "Dogfood missing_assert_message on Clippy"
This reverts commit ec653570ad50d11ecc3b5649dd28e29ed96199d3.
2023-03-08 08:51:50 +00:00
Burak Varlı
8f3ac65227 Dogfood missing_assert_message on Clippy
Co-authored-by: Weihang Lo <me@weihanglo.tw>
2023-03-08 08:51:24 +00:00
Andreas Deininger
03a3f74365 Fixing typos 2023-02-27 21:45:26 +01:00
bors
149392b0ba Auto merge of #10402 - Jarcho:rustup, r=Jarcho
Rustup

Looks like `@flip1995`  is busy.

r? `@ghost`

changelog: None
2023-02-25 23:34:06 +00:00
Samuel Tardieu
64775f30c2 Do not panic when analyzing the malformed origin of a format string 2023-02-25 23:48:17 +01:00
Jason Newcomb
bc184e9c7d Merge branch 'master' into rustup 2023-02-25 17:43:19 -05:00
Alan Egerton
430c4ab7ff Remove type-traversal trait aliases 2023-02-22 17:04:58 +00:00
Jason Newcomb
0aad34e43f Normalize projections types when checking explicit_auto_deref 2023-02-21 15:59:06 -05:00
Nicholas Nethercote
71b8646854 Use ThinVec in various AST types.
This commit changes the sequence parsers to produce `ThinVec`, which
triggers numerous conversions.
2023-02-21 11:51:56 +11:00
Boxy
8a66a6816b Add Clause::ConstArgHasType variant 2023-02-17 09:30:33 +00:00
Kyle Matsuda
98c4a49db8 remove bound_type_of query; make type_of return EarlyBinder; change type_of in metadata 2023-02-16 17:05:56 -07:00
Kyle Matsuda
f0565c939e change usages of type_of to bound_type_of 2023-02-16 17:01:52 -07:00
Jirka Vebr
0b1ae20365
Fix dogfood tests by adding type annotations 2023-02-16 13:29:38 +01:00
Matthias Krüger
dd6534ae87 Rollup merge of #108047 - oli-obk:machine->🞋, r=RalfJung
Use `target` instead of `machine` for mir interpreter integer handling.

The naming of `machine` only makes sense from a mir interpreter internals perspective, but outside users talk about the `target` platform. As per https://github.com/rust-lang/rust/pull/108029#issuecomment-1429791015

r? `@RalfJung`
2023-02-15 21:30:57 +01:00
bors
30f38d69ab Auto merge of #108006 - cjgillot:def-impl, r=oli-obk
Avoid accessing HIR when it can be avoided

Experiment to see if it helps some incremental cases.

Will be rebased once https://github.com/rust-lang/rust/pull/107942 gets merged.

r? `@ghost`
2023-02-15 16:14:10 +00:00
Oli Scherer
cecc45cedc Use target instead of machine for mir interpreter integer handling.
The naming of `machine` only makes sense from a mir interpreter internals perspective, but outside users talk about the `target` platform
2023-02-15 08:56:18 +00:00
bors
5a8b288712 Auto merge of #108056 - matthiaskrgr:rollup-oa6bxvh, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #107573 (Update the minimum external LLVM to 14)
 - #107626 (Fix `x fix` on the standard library itself)
 - #107673 (update ICU4X to 1.1.0)
 - #107733 (Store metrics from `metrics.json` to CI PGO timer)
 - #108007 (Use `is_str` instead of string kind comparison)
 - #108033 (add an unstable `#[rustc_coinductive]` attribute)
 - #108039 (Refactor refcounted structural_impls via functors)
 - #108040 (Use derive attributes for uninteresting traversals)
 - #108044 (interpret: rename Pointer::from_addr → from_addr_invalid)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-02-14 21:07:04 +00:00
Camille GILLOT
e41c37316d Add of_trait to DefKind::Impl. 2023-02-14 19:55:44 +00:00
Matthias Krüger
b8c36429e4 Rollup merge of #108007 - compiler-errors:str-less-kind, r=Nilstrieb
Use `is_str` instead of string kind comparison

Split out from #107939
2023-02-14 18:24:42 +01:00
Oli Scherer
e3a739a115 s/eval_usize/eval_target_usize/ for clarity 2023-02-14 08:51:19 +00:00
Michael Goulet
4b8f112d09 Use is_str instead of string kind comparison 2023-02-13 19:06:22 +00:00
Alan Egerton
340d9e818a Make visiting traits generic over the Interner 2023-02-13 10:24:49 +00:00
Alan Egerton
e8e9c32af9 Alias folding/visiting traits instead of re-export 2023-02-13 10:24:46 +00:00
bors
863e96d626 Auto merge of #107507 - BoxyUwU:deferred_projection_equality, r=lcnr
Implement `deferred_projection_equality` for erica solver

Somewhat of a revival of #96912. When relating projections now emit an `AliasEq` obligation instead of attempting to determine equality of projections that may not be as normalized as possible (i.e. because of lazy norm, or just containing inference variables that prevent us from resolving an impl). Only do this when the new solver is enabled
2023-02-11 05:46:24 +00:00
Mara Bos
145e6a94d6 Add suspicious_command_arg_space lint. 2023-02-10 19:02:39 +01:00
Boxy
cd3bcbb8e5 add AliasEq to PredicateKind 2023-02-10 13:44:46 +00:00
Philipp Krones
e7fe1f9c14 Merge commit '0f7558148c22e53cd4608773b56cdfa50dcdeac3' into clippyup 2023-02-10 14:01:19 +01:00
Philipp Krones
7c61b4ed89
Merge remote-tracking branch 'upstream/master' into rustup 2023-02-10 11:33:45 +01:00
bors
17369f324c Auto merge of #106227 - bryangarza:ctfe-limit, r=oli-obk
Use stable metric for const eval limit instead of current terminator-based logic

This patch adds a `MirPass` that inserts a new MIR instruction `ConstEvalCounter` to any loops and function calls in the CFG. This instruction is used during Const Eval to count against the `const_eval_limit`, and emit the `StepLimitReached` error, replacing the current logic which uses Terminators only.

The new method of counting loops and function calls should be more stable across compiler versions (i.e., not cause crates that compiled successfully before, to no longer compile when changes to the MIR generation/optimization are made).

Also see: #103877
2023-01-29 04:11:27 +00:00
bors
79475f56ec Auto merge of #107206 - cjgillot:no-h2l-map, r=WaffleLapkin
Remove HirId -> LocalDefId map from HIR.

Having this map in HIR prevents the creating of new definitions after HIR has been built.
Thankfully, we do not need it.

Based on https://github.com/rust-lang/rust/pull/103902
2023-01-28 16:11:33 +00:00
Camille GILLOT
3e32533cc2 Remove HirId -> LocalDefId map from HIR. 2023-01-28 09:55:26 +00:00
Camille GILLOT
92c4f1e2d9 Take a LocalDefId in hir::Visitor::visit_fn. 2023-01-28 09:51:50 +00:00
Scott McMurray
e65a7ff0b3 Remove from librustdoc and clippy too 2023-01-27 20:44:19 -08:00
bors
997fe0d57e Auto merge of #107386 - flip1995:clippyup, r=Manishearth
Update Clippy

r? `@Manishearth`
2023-01-27 21:20:39 +00:00
Philipp Krones
5c7a65251a Merge commit '1480cea393d0cee195e59949eabdfbcf1230f7f9' into clippyup 2023-01-27 21:09:08 +01:00
Philipp Krones
6f9c70a201
Bump Clippy version -> 0.1.69 2023-01-27 20:27:00 +01:00
Philipp Krones
2bc2431fd1
Merge remote-tracking branch 'upstream/master' into rustup 2023-01-27 20:26:35 +01:00
bors
bcb90528c0 Auto merge of #107372 - JohnTitor:rollup-zkl2ges, r=JohnTitor
Rollup of 9 pull requests

Successful merges:

 - #106806 (Replace format flags u32 by enums and bools.)
 - #107194 (Remove dependency on slice_internals feature in rustc_ast)
 - #107234 (Revisit fix_is_ci_llvm_available logic)
 - #107316 (Update snap from `1.0.1` to `1.1.0`)
 - #107321 (solver comments + remove `TyCtxt::evaluate_goal`)
 - #107332 (Fix wording from `rustbuild` to `bootstrap`)
 - #107347 (reduce rightward-drift)
 - #107352 (compiler: Fix E0587 explanation)
 - #107357 (Fix infinite loop in rustdoc get_all_import_attributes function)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-01-27 17:49:56 +00:00
Mara Bos
b64a20930c Update clippy for restructured format flags fields. 2023-01-27 08:53:41 +01:00
Kyle Matsuda
afb586fa1f change fn_sig query to use EarlyBinder; remove bound_fn_sig query; add EarlyBinder to fn_sig in metadata 2023-01-26 20:28:25 -07:00
Kyle Matsuda
38899d0c29 replace usages of fn_sig query with bound_fn_sig 2023-01-26 20:15:36 -07:00
bors
a64940f948 Auto merge of #106745 - m-ou-se:format-args-ast, r=oli-obk
Move format_args!() into AST (and expand it during AST lowering)

Implements https://github.com/rust-lang/compiler-team/issues/541

This moves FormatArgs from rustc_builtin_macros to rustc_ast_lowering. For now, the end result is the same. But this allows for future changes to do smarter things with format_args!(). It also allows Clippy to directly access the ast::FormatArgs, making things a lot easier.

This change turns the format args types into lang items. The builtin macro used to refer to them by their path. After this change, the path is no longer relevant, making it easier to make changes in `core`.

This updates clippy to use the new language items, but this doesn't yet make clippy use the ast::FormatArgs structure that's now available. That should be done after this is merged.
2023-01-26 12:44:47 +00:00
Bryan Garza
520814b713 Update Clippy for ConstEvalCounter 2023-01-23 23:56:22 +00:00
Kyle Matsuda
2bfba8685d fix missing subst in clippy utils 2023-01-17 08:55:28 -07:00
Kyle Matsuda
a084d7908c change item_bounds query to return EarlyBinder; remove bound_item_bounds query 2023-01-17 08:55:28 -07:00
Kyle Matsuda
5dac27503f change usages of item_bounds query to bound_item_bounds 2023-01-17 08:55:27 -07:00
bors
07a7603994 Auto merge of #10187 - dswij:issue-10182-semicolon, r=Jarcho
[needless_return]: Remove all semicolons on suggestion

Closes #10182

Multiple semicolons currently breaks autofix for `needless_return` suggestions. Any semicolons left after removing return means that the return type will always be `()`, and thus fail to compile.

This PR allows `needless_return` to remove multiple semicolons.

The change won't cover the case where there is multiple line yet.

i.e.

```rust
fn needless_return() -> bool {
    return true;
;;
}
```

---

changelog: Sugg: [`needless_return`]: Now removes all semicolons on the same line
[#10187](https://github.com/rust-lang/rust-clippy/pull/10187)
<!-- changelog_checked -->
2023-01-15 15:49:40 +00:00
Philipp Krones
d21616737b Merge commit '7f27e2e74ef957baa382dc05cf08df6368165c74' into clippyup 2023-01-12 19:48:13 +01:00
bors
7f27e2e74e Auto merge of #10192 - Jarcho:revert_9701, r=flip1995
Partially revert #9701

This partially reverts #9701 due to #10134

r? `@flip1995`

changelog: None
2023-01-12 18:47:17 +00:00