-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert the lexing of c"…"
string literals
#113334
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rustbot
added
A-testsuite
Area: The testsuite used to check the correctness of rustc
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
T-bootstrap
Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
labels
Jul 4, 2023
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
rustbot
added
beta-nominated
Nominated for backporting to the compiler in the beta channel.
F-c_str_literals
`#![feature(c_str_literals)]`
labels
Jul 4, 2023
This comment has been minimized.
This comment has been minimized.
This comment was marked as outdated.
This comment was marked as outdated.
fmease
commented
Jul 4, 2023
fmease
force-pushed
the
revert-lexing-c-str-lits
branch
from
July 4, 2023 19:52
306679b
to
8460f6a
Compare
fmease
force-pushed
the
revert-lexing-c-str-lits
branch
from
July 5, 2023 11:15
8460f6a
to
1ed0736
Compare
fmease
force-pushed
the
revert-lexing-c-str-lits
branch
from
July 5, 2023 11:19
1ed0736
to
cfeabbf
Compare
fmease
force-pushed
the
revert-lexing-c-str-lits
branch
from
July 5, 2023 11:45
cfeabbf
to
22fd6a6
Compare
m-ou-se
removed
the
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
label
Jul 5, 2023
@bors r+ |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Jul 5, 2023
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 6, 2023
…fee1-dead Rollup of 9 pull requests Successful merges: - rust-lang#111119 (style-guide: Add chapter about formatting for nightly-only syntax) - rust-lang#112791 (llvm ffi: Expose `CallInst->setTailCallKind`) - rust-lang#113145 (style-guide: Document newline rules for assignment operators) - rust-lang#113163 (Add a regression test for rust-lang#112895) - rust-lang#113332 (resolve: Use `Interned` for some interned structures) - rust-lang#113334 (Revert the lexing of `c"…"` string literals) - rust-lang#113350 (Fix the issue of wrong diagnosis for extern pub fn) - rust-lang#113371 (Fix submodule handling when the current branch is named after a tag) - rust-lang#113384 (style-guide: Clarify grammar for small patterns (not a semantic change)) r? `@ghost` `@rustbot` modify labels: rollup
rustbot
added
the
beta-accepted
Accepted for backporting to the compiler in the beta channel.
label
Jul 6, 2023
12 tasks
matthiaskrgr
pushed a commit
to matthiaskrgr/rust
that referenced
this pull request
Jul 7, 2023
Comments out the C string literals due to rust-lang#113334 Fixes rust-lang/rust-clippy#11121
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Jul 7, 2023
Fix failing clippy tests Comments out the C string literals due to rust-lang#113334 Fixes rust-lang/rust-clippy#11121 Opened against `rust-lang/rust` in order to unblock rust-lang#113450 r? `@Nilstrieb`
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this pull request
Jul 7, 2023
Fix failing clippy tests Comments out the C string literals due to rust-lang#113334 Fixes rust-lang/rust-clippy#11121 Opened against `rust-lang/rust` in order to unblock rust-lang#113450 r? ``@Nilstrieb``
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 8, 2023
Fix failing clippy tests Comments out the C string literals due to rust-lang#113334 Fixes rust-lang/rust-clippy#11121 Opened against `rust-lang/rust` in order to unblock rust-lang#113450 r? `@Nilstrieb`
Mark-Simulacrum
removed
the
beta-nominated
Nominated for backporting to the compiler in the beta channel.
label
Jul 8, 2023
Merged
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 8, 2023
…k-Simulacrum [beta] backport This PR backports: - rust-lang#113334: Revert the lexing of `c"…"` string literals - rust-lang#113231: Fix `dropping_copy_types` lint from linting in match-arm with side-effects - rust-lang#112794: Fix linker failures when #[global_allocator] is used in a dependency r? `@Mark-Simulacrum`
trvswgnr
added a commit
to crablang/crab
that referenced
this pull request
Jul 9, 2023
commit 03247fbbe87b28a991d721c4fe7cdf4e6fc5d5a3 Merge: 83964c156db 8a08a2954e8 Author: bors <[email protected]> Date: Sun Jul 9 01:55:53 2023 +0000 Auto merge of #113485 - Mark-Simulacrum:bump-version, r=Mark-Simulacrum Bump version to 1.73 r? `@Mark-Simulacrum` commit 83964c156db1f444050a38b2498dbd0da6d5d503 Merge: d1389b9b489 de9b9c833b5 Author: bors <[email protected]> Date: Sat Jul 8 20:56:57 2023 +0000 Auto merge of #113491 - matthiaskrgr:rollup-mueqz7h, r=matthiaskrgr Rollup of 6 pull requests Successful merges: - #113005 (Don't call `query_normalize` when reporting similar impls) - #113064 (std: edit [T]::swap docs) - #113138 (Add release notes for 1.71.0) - #113217 (resolve typerelative ctors to adt) - #113254 (Use consistent formatting in Readme) - #113482 (Migrate GUI colors test to original CSS color format) r? `@ghost` `@rustbot` modify labels: rollup commit de9b9c833b5e39f4d364b1047de9743f7ff03e13 Merge: dd8322876e8 50b4d1f4134 Author: Matthias Krüger <[email protected]> Date: Sat Jul 8 20:53:30 2023 +0200 Rollup merge of #113482 - GuillaumeGomez:migrate-gui-test-color-20, r=notriddle Migrate GUI colors test to original CSS color format Follow-up of https://github.com/rust-lang/rust/pull/111459. r? ``@notriddle`` commit dd8322876e85938a6e92551299e27ebc5ef177e6 Merge: b637be7a17b 7bb9de87f66 Author: Matthias Krüger <[email protected]> Date: Sat Jul 8 20:53:30 2023 +0200 Rollup merge of #113254 - atouchet:rd3, r=Mark-Simulacrum Use consistent formatting in Readme commit b637be7a17be5c5a3b7bb45ff481e8f3705a91a2 Merge: 14aeef369c1 261c0231232 Author: Matthias Krüger <[email protected]> Date: Sat Jul 8 20:53:29 2023 +0200 Rollup merge of #113217 - ericmarkmartin:lower-type-relative-ctor-to-adt, r=cjgillot resolve typerelative ctors to adt Associated issue: #110508 r? ``@spastorino`` commit 14aeef369c103159acd7e7aead6f3d0d0fd1d3f7 Merge: 8c562996dd2 a30f797437e Author: Matthias Krüger <[email protected]> Date: Sat Jul 8 20:53:28 2023 +0200 Rollup merge of #113138 - cuviper:relnotes-1.71.0, r=Mark-Simulacrum Add release notes for 1.71.0 r? ``@Mark-Simulacrum`` cc ``@rust-lang/release`` commit 8c562996dd2247422adec450b0dbcd2c55a737f1 Merge: 48a0d038fa7 30c61eece4c Author: Matthias Krüger <[email protected]> Date: Sat Jul 8 20:53:27 2023 +0200 Rollup merge of #113064 - marcospb19:add-note-in-vec-swap-docs, r=Mark-Simulacrum std: edit [T]::swap docs Add a note about what happens when index arguments are equal. commit 48a0d038fa7659c199c97095877a320b62d09ddf Merge: 4353b1ecd65 2c33dfea765 Author: Matthias Krüger <[email protected]> Date: Sat Jul 8 20:53:27 2023 +0200 Rollup merge of #113005 - compiler-errors:dont-query-normalize, r=cjgillot Don't call `query_normalize` when reporting similar impls Firstly, It's sketchy to be using `query_normalize` at all during HIR typeck -- it's asking for an ICE 😅. Secondly, we're normalizing an impl trait ref that potentially has parameter types in `ty::ParamEnv::empty()`, which is kinda sketchy as well. The only UI test change from removing this normalization is that we don't evaluate anonymous constants in impls, which end up giving us really ugly suggestions: ``` error[E0277]: the trait bound `[X; 35]: Default` is not satisfied --> /home/gh-compiler-errors/test.rs:4:5 | 4 | <[X; 35] as Default>::default(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Default` is not implemented for `[X; 35]` | = help: the following other types implement trait `Default`: &[T] &mut [T] [T; 32] [T; core::::array::{impl#30}::{constant#0}] [T; core::::array::{impl#31}::{constant#0}] [T; core::::array::{impl#32}::{constant#0}] [T; core::::array::{impl#33}::{constant#0}] [T; core::::array::{impl#34}::{constant#0}] and 27 others ``` So just fold the impls with a `BottomUpFolder` that calls `ty::Const::eval`. This doesn't work totally correctly with generic-const-exprs, but it's fine for stable code, and this is error reporting after all. commit d1389b9b4895e52ec7d1859a2d86e96babfb5d76 Merge: 4353b1ecd65 39f558f8cf0 Author: bors <[email protected]> Date: Sat Jul 8 18:36:58 2023 +0000 Auto merge of #113484 - matthiaskrgr:rollup-goq2u0d, r=matthiaskrgr Rollup of 7 pull requests Successful merges: - #112931 (Enable zlib in LLVM on aarch64-apple-darwin) - #113158 (tests: unset `RUSTC_LOG_COLOR` in a test) - #113173 (CI: include workflow name in concurrency group) - #113335 (Reveal opaques in new solver) - #113390 (CGU formation tweaks) - #113399 (Structurally normalize again for byte string lit pat checking) - #113412 (Add basic types to SMIR) r? `@ghost` `@rustbot` modify labels: rollup commit 4353b1ecd65d493c9f503aacff07a3f98d0b0340 Merge: 9bb6fbe2619 d8c29b82c97 Author: bors <[email protected]> Date: Sat Jul 8 16:12:28 2023 +0000 Auto merge of #113450 - Nilstrieb:src/bootstrap/test.rs, r=flip1995 Fail the build if clippy tests don't pass This was removed in https://github.com/rust-lang/rust/pull/113260/commits/de69d556eb5006a21f868b8c12d48f0ef1308a5a#diff-8479eab02701e686aedb15b567dc8fc31220c6e4efb9565ccc9d662b7fee2214 which caused CI to ignore clippy failures. This adds back the exit, which should cause CI to fail again if a test is broken (like right now, as clippy tests are broken on master). Also see https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/CI.20doesn't.20care.20about.20clippy.20test.20failures.20but.20only.20sometime r? flip1995 commit d8c29b82c9732087881da93a429431e5f2da346d Author: Nilstrieb <[email protected]> Date: Sat Jul 8 17:17:40 2023 +0200 Delete `to_string_in_format_args_incremental.rs` It fails CI and passes locally. It passes random directores in `-Cincremental` so maybe something's up. It shouldn't block us here. commit c80333edfb584e054b7ac337cca6d98f59c507ba Author: Nilstrieb <[email protected]> Date: Fri Jul 7 19:06:47 2023 +0200 Fail the build if clippy tests don't pass This was removed in https://github.com/rust-lang/rust/pull/113260/commits/de69d556eb5006a21f868b8c12d48f0ef1308a5a#diff-8479eab02701e686aedb15b567dc8fc31220c6e4efb9565ccc9d662b7fee2214 which caused CI to ignore clippy failures. This adds back the exit, which should cause CI to fail again if a test is broken (like right now, as clippy tests are broken on master). commit 8a08a2954e8d6c5f584816241dc414bc09863fe8 Author: Mark Rousskov <[email protected]> Date: Sat Jul 8 10:35:49 2023 -0400 Bump version commit 39f558f8cf0174493ed6c81de11ec372de3d0849 Merge: 8dc9461c91b 9ca51b92d4a Author: Matthias Krüger <[email protected]> Date: Sat Jul 8 15:49:47 2023 +0200 Rollup merge of #113412 - spastorino:smir-types-1, r=oli-obk Add basic types to SMIR Still incomplete but I think this can be merged and we can keep iterating over it. r? ``@oli-obk`` commit 8dc9461c91b84521933ad7e93fc79ce1d28d6491 Merge: d5b1ef98b07 906d2b172c9 Author: Matthias Krüger <[email protected]> Date: Sat Jul 8 15:49:47 2023 +0200 Rollup merge of #113399 - compiler-errors:next-solver-byte-pat-again, r=oli-obk Structurally normalize again for byte string lit pat checking We need to structurally normalize the pointee of a match scrutinee when trying to match byte string patterns -- we used[^1] to call `structurally_resolve_type`, which errors for type vars[^2], but lcnr added `try_structurally_resolve_type`[^3] in the mean time, which is the right thing to use here since it's totally opportunistic. Fixes rust-lang/trait-system-refactor-initiative#38 [^1]: #112428 [^2]: #112993 [^3]: #113086 commit d5b1ef98b07ebdf41b9c6ec50252d51ed206c795 Merge: f3f1b0394d5 3078e4d804f Author: Matthias Krüger <[email protected]> Date: Sat Jul 8 15:49:46 2023 +0200 Rollup merge of #113390 - nnethercote:cgu-tweaks, r=wesleywiser CGU formation tweaks Minor improvements I found while trying out something bigger that didn't work out. r? ``@wesleywiser`` commit f3f1b0394d5aae12855dad5a5c35ceaefb8d40fc Merge: e0b290f1a8d f55b046931c Author: Matthias Krüger <[email protected]> Date: Sat Jul 8 15:49:46 2023 +0200 Rollup merge of #113335 - compiler-errors:reveal-opaques-in-new-solver, r=lcnr Reveal opaques in new solver We were testing against the wrong reveal mode :fearful: Also a couple of misc commits that I don't want to really put in separate prs r? ``@lcnr`` commit e0b290f1a8dfd2cf6dbad94c0425f04f387842d1 Merge: b70c5538b6c f88024627b8 Author: Matthias Krüger <[email protected]> Date: Sat Jul 8 15:49:45 2023 +0200 Rollup merge of #113173 - Kobzol:ci-concurrency-group-workflow, r=pietroalbini CI: include workflow name in concurrency group Currently, this won't change anything, because we only have one relevant workflow (`CI`), but for future proofing we should probably include the workflow name in the concurrency group. Found by ``@klensy`` [here](https://github.com/rust-lang/rust/pull/113059#discussion_r1247213606). commit b70c5538b6ceaa60a2fad44d1753f101b71e5584 Merge: 3e03a48c18c 181d7b463ba Author: Matthias Krüger <[email protected]> Date: Sat Jul 8 15:49:45 2023 +0200 Rollup merge of #113158 - davidtwco:unset-rustc-log-color-in-test, r=wesleywiser tests: unset `RUSTC_LOG_COLOR` in a test Setting `RUSTC_LOG_COLOR=always` is sometimes useful if tools that one pipes `RUSTC_LOG` into support coloured output, but it makes this test fail because it has a `.stderr` file with `WARN` log output. commit 3e03a48c18c4465380dca49a41add1609c09d2d8 Merge: ce519c5945c d43131b5c82 Author: Matthias Krüger <[email protected]> Date: Sat Jul 8 15:49:44 2023 +0200 Rollup merge of #112931 - cbeuw:apple-zlib, r=Mark-Simulacrum Enable zlib in LLVM on aarch64-apple-darwin Works on macOS 13.4, Xcode version 14.3.1.0.1.1683849156 This was disabled in #75500 on Apple Silicon Developer Transition Kit, but Apple appears to have fixed their zlib now commit 9bb6fbe26198e58b517bfbf58a3348fad98d1654 Merge: ce519c5945c 2beabbbf6fd Author: bors <[email protected]> Date: Sat Jul 8 13:48:30 2023 +0000 Auto merge of #113376 - Nilstrieb:pointer-coercions-are-not-casts-because-that-sounds-way-to-general-aaaa, r=oli-obk Rename `adjustment::PointerCast` and variants using it to `PointerCoercion` It makes it sounds like the `ExprKind` and `Rvalue` are supposed to represent all pointer related casts, when in reality their just used to share a little enum variants. Make it clear there these are only coercions and that people who see this and think "why are so many pointer related casts not in these variants" aren't insane. This enum was added in #59987. I'm not sure whether the variant sharing is actually worth it, but this at least makes it less confusing. r? oli-obk commit 50b4d1f4134f91354ed71e6e08d91f21015a626b Author: Guillaume Gomez <[email protected]> Date: Sat Jul 8 14:55:50 2023 +0200 Migrate GUI colors test to original CSS color format commit ce519c5945c90596cf429dc2a91c846daeb75cd1 Merge: d4096e0412a 7a22c7e6f4a Author: bors <[email protected]> Date: Sat Jul 8 10:46:29 2023 +0000 Auto merge of #113474 - compiler-errors:rollup-07x1up7, r=compiler-errors Rollup of 8 pull requests Successful merges: - #113413 (Add needs-triage to all new issues) - #113426 (Don't ICE in `resolve_bound_vars` when associated return-type bounds are in bad positions) - #113427 (Remove `variances_of` on RPITIT GATs, remove its one use-case) - #113441 (miri: check that assignments do not self-overlap) - #113453 (Remove unused from_method from rustc_on_unimplemented) - #113456 (Avoid calling report_forbidden_specialization for RPITITs) - #113466 (Update cargo) - #113467 (Fix comment of `fn_can_unwind`) r? `@ghost` `@rustbot` modify labels: rollup commit 7a22c7e6f4a18e0dd3427ce2c3c8bf4cda882ad3 Merge: 083b2d409c6 39c3ef799f4 Author: Michael Goulet <[email protected]> Date: Fri Jul 7 22:12:19 2023 -0700 Rollup merge of #113467 - nbdd0121:unwind, r=compiler-errors Fix comment of `fn_can_unwind` Reopen of #113213 commit 083b2d409c67ed3361b46e5e065dc8bd767cd4c7 Merge: cf1f8c55d56 b9a4cfe05ee Author: Michael Goulet <[email protected]> Date: Fri Jul 7 22:12:18 2023 -0700 Rollup merge of #113466 - weihanglo:update-cargo, r=weihanglo Update cargo 1 commits in 5b377cece0e0dd0af686cf53ce4637d5d85c2a10..45782b6b8afd1da042d45c2daeec9c0744f72cc7 2023-06-30 00:01:00 +0000 to 2023-07-05 16:54:51 +0000 - docs(ref): Provide guidance on version requirements (rust-lang/cargo#12323) r? ``@ghost`` commit cf1f8c55d565b3da83d4ed2ca635400481f081a6 Merge: 37a05d80544 24326ee5081 Author: Michael Goulet <[email protected]> Date: Fri Jul 7 22:12:18 2023 -0700 Rollup merge of #113456 - spastorino:new-rpitit-31, r=compiler-errors Avoid calling report_forbidden_specialization for RPITITs Fixes #113438 r? ``@compiler-errors`` commit 37a05d8054447c1d439cca6e2f1938d51905de53 Merge: 2b78119671b 6d80879ab99 Author: Michael Goulet <[email protected]> Date: Fri Jul 7 22:12:17 2023 -0700 Rollup merge of #113453 - spastorino:new-rpitit-30, r=compiler-errors Remove unused from_method from rustc_on_unimplemented Fixes #113439 `on_unimplemented_note` was calling `item_name` for RPITITs and that produced ICEs. I've added a regression test for that but also have removed `from_method` symbol entirely because it wasn't even used and by doing that the `item_name` call was also removed. r? ``@compiler-errors`` commit 2b78119671bf35346a8f570e574724ae90537938 Merge: 751dcaceb43 7a83ef82da9 Author: Michael Goulet <[email protected]> Date: Fri Jul 7 22:12:17 2023 -0700 Rollup merge of #113441 - RalfJung:assign-no-overlap, r=oli-obk miri: check that assignments do not self-overlap r? `````@oli-obk````` commit 751dcaceb432139bbff9513866c73ca6d3996e56 Merge: a13b57e6363 ca8202d429b Author: Michael Goulet <[email protected]> Date: Fri Jul 7 22:12:16 2023 -0700 Rollup merge of #113427 - compiler-errors:no-variances-of-rpitit-gat, r=spastorino Remove `variances_of` on RPITIT GATs, remove its one use-case It doesn't make sense to implement variances on a GAT anyways, since we don't relate GATs with variance: https://github.com/rust-lang/rust/blob/85bf07972a1041b9e25393b803d0e006bec3eaaf/compiler/rustc_middle/src/ty/relate.rs#L569-L579 r? ``@spastorino`` commit a13b57e636354c6bc926c710500873fe73ddab04 Merge: 77a6c7f3a16 b7191d8388a Author: Michael Goulet <[email protected]> Date: Fri Jul 7 22:12:16 2023 -0700 Rollup merge of #113426 - compiler-errors:rtn-in-impl-header, r=fee1-dead Don't ICE in `resolve_bound_vars` when associated return-type bounds are in bad positions I couldn't find a better way to avoid hitting this ICE, so let's just delay it. The problem is that we really shouldn't even be *trying* to visit associated type bounds in `resolve_bound_vars` when they show up in impl headers, but we don't have enough context to do this. Fixes #113423 commit 77a6c7f3a16910878f3d03e52f6638ab276d3008 Merge: eee6b31c0c3 a118ce2176c Author: Michael Goulet <[email protected]> Date: Fri Jul 7 22:12:15 2023 -0700 Rollup merge of #113413 - Nilstrieb:this-needs-some-triaging, r=albertlarsan68 Add needs-triage to all new issues Closes #113261 The label: https://github.com/rust-lang/rust/labels/needs-triage commit d4096e0412ac5de785d739a0aa2b1c1c7b9d3b7d Merge: eee6b31c0c3 c3004a7b652 Author: bors <[email protected]> Date: Sat Jul 8 03:22:54 2023 +0000 Auto merge of #112652 - oli-obk:tait_only_in_sig, r=compiler-errors Require TAITs to be mentioned in the signatures of functions that register hidden types for them r? `@lcnr` `@compiler-errors` This implements the lang team decision from [the TAIT design meeting](https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/design.20meeting.202023-05-31.20TAITs/near/362518164). commit eee6b31c0c3b7c3ad8733957eaa122ae1a07e299 Merge: cb80ff132a0 cedcd39cfd3 Author: bors <[email protected]> Date: Sat Jul 8 00:01:19 2023 +0000 Auto merge of #113455 - Alexendoo:clippy-tests, r=Nilstrieb Fix failing clippy tests Comments out the C string literals due to https://github.com/rust-lang/rust/pull/113334 Fixes https://github.com/rust-lang/rust-clippy/issues/11121 Opened against `rust-lang/rust` in order to unblock https://github.com/rust-lang/rust/pull/113450 r? `@Nilstrieb` commit b9a4cfe05ee5f082351c71572451641a2f6e345c Author: Weihang Lo <[email protected]> Date: Fri Jul 7 23:17:40 2023 +0100 Update cargo commit b7191d8388abfb7c66b5fea9120cdf07c640edfa Author: Michael Goulet <[email protected]> Date: Thu Jul 6 22:40:55 2023 +0000 Don't ICE in resolve_bound_vars when associated return-type bounds are in bad positions commit 24326ee5081a28628f0046d25764408b7bf4e2ca Author: Santiago Pastorino <[email protected]> Date: Fri Jul 7 15:24:10 2023 -0300 Avoid calling report_forbidden_specialization for RPITITs commit 6d80879ab991b47880410da62167a54c097275e8 Author: Santiago Pastorino <[email protected]> Date: Fri Jul 7 15:58:25 2023 -0300 Add regression test for RPITITs commit 3aec8d4227e3bd7ac14cfd93c990223e3f868229 Author: Santiago Pastorino <[email protected]> Date: Fri Jul 7 15:57:30 2023 -0300 Remove unused from_method symbol commit cedcd39cfd31946112f0a1f5c77ec58451893f6d Author: Alex Macleod <[email protected]> Date: Fri Jul 7 18:18:25 2023 +0000 Fix failing clippy tests Comments out the C string literals due to https://github.com/rust-lang/rust/pull/113334 Fixes https://github.com/rust-lang/rust-clippy/issues/11121 commit 9ca51b92d4a056d22d3b3d22e54bbb29ed205a40 Author: Santiago Pastorino <[email protected]> Date: Wed Jul 5 19:30:24 2023 -0300 Add Float ty to SMIR commit 42eccffce3e950e95d9e965d4dd58ecb44633d55 Author: Santiago Pastorino <[email protected]> Date: Wed Jul 5 19:26:52 2023 -0300 Add Uint ty to SMIR commit 458ead41d621a6aacdf0d27169a4aa9d1ff54f98 Author: Santiago Pastorino <[email protected]> Date: Wed Jul 5 19:06:49 2023 -0300 Add Int ty to SMIR commit 73e816e37ce028274d603ab33d8717d35dc9e914 Author: Santiago Pastorino <[email protected]> Date: Wed Jul 5 19:01:11 2023 -0300 Add Char ty to SMIR commit 61adcaf87b605f1b2d73f62cda813329cb448807 Author: Santiago Pastorino <[email protected]> Date: Wed Jul 5 18:50:13 2023 -0300 Add rustc_ty_to_ty basic tests commit 2beabbbf6fd0ccbd986920ad1650b39081c1eaaa Author: Nilstrieb <[email protected]> Date: Wed Jul 5 20:07:03 2023 +0200 Rename `adjustment::PointerCast` and variants using it to `PointerCoercion` It makes it sound like the `ExprKind` and `Rvalue` are supposed to represent all pointer related casts, when in reality their just used to share a some enum variants. Make it clear there these are only coercion to make it clear why only some pointer related "casts" are in the enum. commit f55b046931cfa1b281375ff8ec4e590d8386f0c4 Author: Michael Goulet <[email protected]> Date: Tue Jul 4 18:49:13 2023 +0000 Normalize opaques during codegen in new solver commit 713f9bb5d1d1d6cb22bc668e326d1c0f0f4f815a Author: Michael Goulet <[email protected]> Date: Tue Jul 4 17:54:23 2023 +0000 Mark more hanging new-solver tests commit 010ee7b0e09c0b1eb6ba7bc745693bd19c9d37e4 Author: Michael Goulet <[email protected]> Date: Tue Jul 4 17:36:26 2023 +0000 Remove an AFIT test that isn't an AFIT test commit cb80ff132a0e9aa71529b701427e4e6c243b58df Merge: fd68a6ded95 7aa5f39d3b5 Author: bors <[email protected]> Date: Fri Jul 7 15:42:29 2023 +0000 Auto merge of #113245 - lukas-code:unsizing-sanity-check, r=the8472 sanity check field offsets in unsizeable structs As promised in https://github.com/rust-lang/rust/pull/112062#issuecomment-1567494994, this PR extends the layout sanity checks to ensure that structs fields don't move around when unsizing and prevent issues like https://github.com/rust-lang/rust/issues/112048 in the future. Like most other layout sanity checks, this only runs on compilers with debug assertions enabled. Here is how it looks when it fails: ```text error: internal compiler error: compiler/rustc_ty_utils/src/layout.rs:533:21: unsizing GcNode<std::boxed::Box<i32>> changed field order! Layout { size: Size(32 bytes), align: AbiAndPrefAlign { abi: Align(8 bytes), pref: Align(8 bytes) }, abi: Aggregate { sized: true }, fields: Arbitrary { offsets: [Size(0 bytes), Size(8 bytes), Size(24 bytes)], memory_index: [0, 1, 2] }, largest_niche: Some(Niche { offset: Size(24 bytes), value: Pointer(AddressSpace(0)), valid_range: 1..=18446744073709551615 }), variants: Single { index: 0 } } Layout { size: Size(24 bytes), align: AbiAndPrefAlign { abi: Align(8 bytes), pref: Align(8 bytes) }, abi: Aggregate { sized: false }, fields: Arbitrary { offsets: [Size(16 bytes), Size(0 bytes), Size(24 bytes)], memory_index: [1, 0, 2] }, largest_niche: None, variants: Single { index: 0 } } ``` r? `@the8472` commit 7a83ef82da92d81be83d430602778f4f4c8fb439 Author: Ralf Jung <[email protected]> Date: Fri Jul 7 16:54:44 2023 +0200 miri: check that assignments do not self-overlap commit c3004a7b6523bfe939df0f73b49f63510557e735 Author: Oli Scherer <[email protected]> Date: Thu Jun 29 13:32:37 2023 +0000 Treat closures as part of their parent commit b549ba1bd4313990d164bc7152e61aefd68eeacd Author: Oli Scherer <[email protected]> Date: Thu Jun 29 07:52:45 2023 +0000 Fix one layer of closures not being able to constrain opaque types commit ef52dc7bb8c14c5663773f70e1353fd53131261c Author: Oli Scherer <[email protected]> Date: Thu Jun 29 07:47:29 2023 +0000 Add regression test commit dcacfe7395cae68ecf8f8efe6803a121f4b74e99 Author: Oli Scherer <[email protected]> Date: Thu Jun 29 07:24:04 2023 +0000 Only match on the `DefKind` once. commit 18f3d8658815f260909b3485b20baa16ffbddde9 Author: Oli Scherer <[email protected]> Date: Thu Jun 29 07:23:11 2023 +0000 Collect nested items immediately instead of collecting them into an intermediate `Vec` first commit b07d27c81e0d40c41c26ea37c19eb61211c76095 Author: Oli Scherer <[email protected]> Date: Thu Jun 29 07:19:06 2023 +0000 Move some logic into a method on `OpaqueTypeCollector` commit af9dcf70be6a7d14619275c9b2d8beebd0743b29 Author: Oli Scherer <[email protected]> Date: Thu Jun 29 07:15:27 2023 +0000 Remove one layer of nested matching on the same thing commit a3ca139defd6f4d93d8f19e7c73a5c94965cca4f Author: Oli Scherer <[email protected]> Date: Thu Jun 29 07:02:29 2023 +0000 liar liar find_taits_declared_in_body on fire commit 2f89c963d3777e03d0ff9f0bcfc11b148a4c0af7 Author: Oli Scherer <[email protected]> Date: Mon Jun 26 17:50:11 2023 +0000 We don't need to track binders if we aren't normalizing commit 907f97e4111b1e52cef13203ec4515449ab4ae59 Author: Oli Scherer <[email protected]> Date: Mon Jun 26 17:49:35 2023 +0000 Remove normalization from `opaque_types_defined_by` commit fd68a6ded951bd7b852ab8107007f7145e3ad6ec Merge: 1a449dcfd25 37fea342ea2 Author: bors <[email protected]> Date: Fri Jul 7 13:15:11 2023 +0000 Auto merge of #113437 - workingjubilee:sync-simd-2023-july-07, r=workingjubilee Sync portable-simd to 2023 July 07 r? `@ghost` commit 4c99872efe97c8e6183dfc9b729bc3a2903ac40b Author: Oli Scherer <[email protected]> Date: Thu Jun 15 09:41:14 2023 +0000 Require TAITs to be mentioned in the signatures of functions that register hidden types for them commit 37fea342ea26bb7042a6acdf683c8210eb2172ff Author: Jubilee Young <[email protected]> Date: Fri Jul 7 04:33:08 2023 -0700 Use new std::simd fn in miri tests Old fn were slightly divergent. commit 8765f9172750111e0b7af489561fba0e2ef22007 Merge: 7cc3da05f99 7c7dbe0c505 Author: Jubilee Young <[email protected]> Date: Fri Jul 7 04:07:00 2023 -0700 Sync portable-simd to 2023 July 07 Sync up to rust-lang/portable-simd@7c7dbe0c505ccbc02ff30c1e37381ab1d47bf46f commit 7c7dbe0c505ccbc02ff30c1e37381ab1d47bf46f Author: Jubilee Young <[email protected]> Date: Fri Jul 7 04:03:54 2023 -0700 Remove unused import commit 789c38fae2f81985dac3c5181bc888a363ac781e Author: Jubilee <[email protected]> Date: Fri Jul 7 03:49:42 2023 -0700 Fixed cast imports in doctest (rust-lang/portable-simd#355) commit f2f9bd7eb178bb19ba2f935903cf4de95b3952f5 Author: Jubilee Young <[email protected]> Date: Fri Jul 7 03:32:29 2023 -0700 Disable MIPS jobs in CI commit 1a449dcfd25143f7e1f6b6f5ddf1c12af361e2ff Merge: 921f669749a 3f8919c09bb Author: bors <[email protected]> Date: Fri Jul 7 10:32:42 2023 +0000 Auto merge of #113308 - compiler-errors:poly-select, r=lcnr Split `SelectionContext::select` into fns that take a binder and don't *most* usages of `SelectionContext::select` don't need to use a binder, but wrap them in a dummy because of the signature. Let's split this out into `SelectionContext::{select,poly_select}` and limit the usages of the latter. Right now, we only have 3 places where we're calling `poly_select` -- fulfillment, internally within the old solver, and the auto-trait finder. r? `@lcnr` commit 2b55e03436d58d0335baaa2ec344914ecc49e0df Merge: 73d7eb5f73b eb0041d1545 Author: Jubilee <[email protected]> Date: Fri Jul 7 03:21:10 2023 -0700 Merge pull request #353 from rust-lang/sync-upstream-2023-06-07 Sync upstream commit 921f669749a57ab5936721fdd93b2da57b581381 Merge: 7cc3da05f99 7916a2c1c9e Author: bors <[email protected]> Date: Fri Jul 7 08:04:48 2023 +0000 Auto merge of #113270 - the8472:opt-macro-tts, r=nnethercote perform TokenStream replacement in-place when possible in expand_macro commit 7cc3da05f99fbc89782fc6cb7e207fa11aa6add5 Merge: bb548f96457 45cb1ba9d30 Author: bors <[email protected]> Date: Fri Jul 7 05:28:17 2023 +0000 Auto merge of #113429 - compiler-errors:rollup-wkv4w9a, r=compiler-errors Rollup of 8 pull requests Successful merges: - #111917 (Simplify duplicate checks for mir validator) - #112008 (Fix incorrect documented default bufsize in bufreader/writer) - #112825 (Don't call `type_of` on TAIT in defining scope in new solver) - #113164 (Add a regression test for #109054) - #113318 (Revert "alloc: Allow comparing Boxs over different allocators", add regression test) - #113397 (Prefer object candidates in new selection) - #113419 (Avoid calling item_name for RPITIT) - #113421 (Do not assert >1 RPITITs on collect_return_position_impl_trait_in_trait_tys) r? `@ghost` `@rustbot` modify labels: rollup commit 45cb1ba9d30452fc332fa28bdda06ac86e80fe25 Merge: 901c8636443 07a230b5a58 Author: Michael Goulet <[email protected]> Date: Thu Jul 6 20:11:41 2023 -0700 Rollup merge of #113421 - spastorino:new-rpitit-29, r=compiler-errors Do not assert >1 RPITITs on collect_return_position_impl_trait_in_trait_tys Fixes #113403 Assert on collect_return_position_impl_trait_in_trait_tys is not correct when we call it from type_of(GAT). The included test is an example of a situation that collector collects 0 types. r? `@compiler-errors` commit 901c86364431f62dbe3f88936e2eeb0d48e43fd8 Merge: f1c90985e87 c0c155137b7 Author: Michael Goulet <[email protected]> Date: Thu Jul 6 20:11:41 2023 -0700 Rollup merge of #113419 - spastorino:new-rpitit-28, r=compiler-errors Avoid calling item_name for RPITIT Fixes #113405 r? `@compiler-errors` commit f1c90985e87f2b144b065b4383ab56657749c372 Merge: 7913d76cb9b 3acaa568c25 Author: Michael Goulet <[email protected]> Date: Thu Jul 6 20:11:40 2023 -0700 Rollup merge of #113397 - compiler-errors:new-select-prefer-obj, r=lcnr Prefer object candidates in new selection `dyn Any` shouldn't be using [this implementation](https://doc.rust-lang.org/std/any/trait.Any.html#impl-Any-for-T) during codegen. Prefer object candidates over other candidates, except for other object candidates. commit 7913d76cb9be2c8a61cbda3833373b81f0a7d736 Merge: 1cb31e71d62 a635bf7a3ba Author: Michael Goulet <[email protected]> Date: Thu Jul 6 20:11:40 2023 -0700 Rollup merge of #113318 - tgross35:113283-allocator-trait-eq, r=m-ou-se Revert "alloc: Allow comparing Boxs over different allocators", add regression test Temporary fix for #113283 Adds a test to fix the regression introduced in 001b081cc1b and revert that commit. The test fails without the revert. commit 1cb31e71d626ee82ebe1a0d0c97dae79649871d3 Merge: de49a9f2f51 86728e74e04 Author: Michael Goulet <[email protected]> Date: Thu Jul 6 20:11:39 2023 -0700 Rollup merge of #113164 - JohnTitor:issue-109054, r=compiler-errors Add a regression test for #109054 Closes #109054 r? ``@compiler-errors`` commit de49a9f2f51757dced984a1b7f45e38d59985b5e Merge: 75febc6ed65 388c230cf77 Author: Michael Goulet <[email protected]> Date: Thu Jul 6 20:11:39 2023 -0700 Rollup merge of #112825 - compiler-errors:tait-defining-cycle, r=lcnr Don't call `type_of` on TAIT in defining scope in new solver It's *never* productive to call `consider_auto_trait_candidate` on a TAIT in the defining scope, since it will always lead to a query cycle since we call `type_of` on the TAIT. So let's just don't. I've reserved this behavior just to `SolverMode::Normal` just to avoid any future problems, since this is *technically* incomplete since we're discarding a candidate that could *theoretically* apply. But given such candidate assembly *always* leads to a query cycle, I think it's relatively low risk, and I could be convinced otherwise and make this apply to both solver mode. I assume it's far less likely to be encountered in coherence, though. This is much more likely to encounter in the new solver, though it can also be encountered in the old solver too, so I'm happy to discuss whether this new behavior we even want in the first place... I encountered this in a couple of failing UI tests: * `tests/ui/type-alias-impl-trait/issue-62000-associate-impl-trait-lifetimes.rs` * `tests/ui/type-alias-impl-trait/issue-93411.rs` r? `@lcnr` commit 75febc6ed65c50f949264d7fa3be7be89fee0407 Merge: 3aa45619238 5488a64654d Author: Michael Goulet <[email protected]> Date: Thu Jul 6 20:11:38 2023 -0700 Rollup merge of #112008 - intruder-kat:master, r=Nilstrieb Fix incorrect documented default bufsize in bufreader/writer commit 3aa456192381cb072da69991d67b19651a81a104 Merge: 06082086b42 cdaef2c435f Author: Michael Goulet <[email protected]> Date: Thu Jul 6 20:11:38 2023 -0700 Rollup merge of #111917 - WaffleLapkin:validate_unalloc, r=oli-obk Simplify duplicate checks for mir validator This removes unnecessary allocations & is less code. commit bb548f964572f7fe652716f5897d9050a31c936e Merge: 06082086b42 462c5c4f3a9 Author: bors <[email protected]> Date: Fri Jul 7 03:02:54 2023 +0000 Auto merge of #112816 - Amanieu:llvm-riscv-arch, r=cuviper Update LLVM submodule This adds https://github.com/rust-lang/llvm-project/pull/147. commit ca8202d429b1d9513d154445774191cd17f39833 Author: Michael Goulet <[email protected]> Date: Fri Jul 7 02:29:57 2023 +0000 Remove variances_of on RPITIT gats, remove its one use-case commit 06082086b42629adee0d37e4e67aa1816a447e23 Merge: 85bf07972a1 e1153590354 Author: bors <[email protected]> Date: Fri Jul 7 00:39:47 2023 +0000 Auto merge of #112796 - Kobzol:ci-merge-msvc-cargo-tools, r=pietroalbini CI: merge msvc cargo and tools jobs The `x86_64-msvc-cargo` and `x86_64-msvc-tools` jobs both run for ~1 hour, but most of that time is actually spent in building LLVM and `rustc`, so I want to try merging them. ![image](https://github.com/rust-lang/rust/assets/4539057/8652fa2a-b8b7-41d0-8f16-555d31acd9a5) commit 388c230cf77c633eeb9eee2e5388ce957c69797b Author: Michael Goulet <[email protected]> Date: Wed Jun 28 17:41:04 2023 +0000 Don't call type_of on TAIT in defining scope in new solver commit 07a230b5a5819d9a0bcfdf77bec8e9d4d9ba1ea9 Author: Santiago Pastorino <[email protected]> Date: Thu Jul 6 16:40:50 2023 -0300 Do not assert >1 RPITITs on collect_return_position_impl_trait_in_trait_tys commit c0c155137b7a80452213ffbf991c52b0faa5025b Author: Santiago Pastorino <[email protected]> Date: Thu Jul 6 16:18:24 2023 -0300 Avoid calling item_name for RPITIT commit 85bf07972a1041b9e25393b803d0e006bec3eaaf Merge: 87c8c83ec73 fd7f53112ab Author: bors <[email protected]> Date: Thu Jul 6 18:58:54 2023 +0000 Auto merge of #113269 - jyn514:update-compiler-builtins, r=Amanieu Update compiler builtins cc https://github.com/rust-lang/compiler-builtins/pull/532#discussion_r1249354225 in particular this pulls in https://github.com/rust-lang/compiler-builtins/pull/532 and https://github.com/rust-lang/compiler-builtins/pull/535. Fixes https://github.com/rust-lang/rust/issues/93166. Fixes https://github.com/rust-lang/git2-rs/issues/706. Fixes https://github.com/rust-lang/rust/issues/109064. Fixes https://github.com/rust-lang/wg-cargo-std-aware/issues/74. commit 284df9fc34ffb5d1e746c31902cbd1982144b45b Author: Santiago Pastorino <[email protected]> Date: Wed Jun 28 11:31:28 2023 -0300 Wrap SMIR bool and tuple into a Rigid variant commit 3f8919c09bbf78b6d1d48fbbacbd63ad5a78cf7a Author: Michael Goulet <[email protected]> Date: Tue Jul 4 01:18:31 2023 +0000 get rid of a bit more calls to poly_select commit 018c3e2c092d73d18169729c4dde92c29924d9d8 Author: Michael Goulet <[email protected]> Date: Mon Jul 3 22:35:28 2023 +0000 Coercion doesn't need binders either commit 52f738499534a2d048a418c37cf4639b8b235bdb Author: Michael Goulet <[email protected]> Date: Mon Jul 3 22:23:37 2023 +0000 Separate select calls that don't need a binder commit 36453456cb2d9d1630aa0a5c68dc7ed9243b5ed4 Author: Michael Goulet <[email protected]> Date: Mon Jul 3 21:42:31 2023 +0000 TraitObligation -> PolyTraitObligation commit 87c8c83ec73eb0dd42e255f82813afa3dde24a57 Merge: c4c84df3b34 0c147d53455 Author: bors <[email protected]> Date: Thu Jul 6 16:14:50 2023 +0000 Auto merge of #112779 - Kobzol:ci-merge-llvm-14, r=pietroalbini CI: merge x86_64-gnu-llvm-14 and x86_64-gnu-llvm-14-stage1 CI jobs Another attempt to shorten CI job times. Suggested by `@the8472` [here](https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/CI.20usage/near/367172221). commit a118ce2176c69f8b982e99f643e8d8135f4f3c94 Author: Nilstrieb <[email protected]> Date: Thu Jul 6 17:57:03 2023 +0200 Add needs-triage to all new issues Closes #113261 commit 7aa5f39d3b55eb746d9d64244ed5343874807ac4 Author: Lukas Markeffsky <@> Date: Wed Jul 5 20:44:24 2023 +0200 add helper methods for accessing struct tail commit e3de14e46396694e48bfecf963fe9fa8e8a90d86 Author: Lukas Markeffsky <@> Date: Sun Jul 2 14:07:08 2023 +0200 sanity check field offsets in unsizeable structs commit 478071ba9daabcdbc880db5638989dc16545537c Author: Lukas Markeffsky <@> Date: Sun Jul 2 14:06:56 2023 +0200 clean up struct layout code commit c4c84df3b34a84506e16093fb4b9ac5cac1ee75a Merge: 4b6749b21e6 12b75fe18b4 Author: bors <[email protected]> Date: Thu Jul 6 13:01:13 2023 +0000 Auto merge of #113323 - Kobzol:pgo-script-llvm-ci, r=jyn514 Use `llvm-config` instead of `download-ci-llvm` in PGO script This should avoid CI breakage when the LLVM stamp is updated, and also it will avoid an unnecessary LLVM download from CI. r? `@jyn514` commit 4b6749b21e680a6280cf05ace533ae20c93d9bff Merge: 4dd1719b340 a7532d92789 Author: bors <[email protected]> Date: Thu Jul 6 10:29:49 2023 +0000 Auto merge of #113406 - matthiaskrgr:rollup-0rprs5k, r=matthiaskrgr Rollup of 4 pull requests Successful merges: - #112295 (Fix the tests-listing-format-json test on Windows) - #113246 (fix compiletest crash) - #113395 (Dont ICE for `dyn* Trait: Trait` (built-in object) goals during selection in new trait solver) - #113402 (Diagnose unsorted CGUs.) r? `@ghost` `@rustbot` modify labels: rollup commit a7532d9278961f5f6188a3a3f525034408812920 Merge: 72e0e177d58 fc8536669ca Author: Matthias Krüger <[email protected]> Date: Thu Jul 6 12:12:12 2023 +0200 Rollup merge of #113402 - nnethercote:diagnose-unsorted-CGUs, r=lqd Diagnose unsorted CGUs. An assertion failure was reported in #112946. This extra information will help diagnose the problem. r? `@lqd` commit 72e0e177d583cb9bd3879e0776e01291ec7563d3 Merge: 1bb5dd65759 cd26d10edfa Author: Matthias Krüger <[email protected]> Date: Thu Jul 6 12:12:12 2023 +0200 Rollup merge of #113395 - compiler-errors:new-solver-dyn-star-selection, r=oli-obk Dont ICE for `dyn* Trait: Trait` (built-in object) goals during selection in new trait solver We were ICEing too eagerly during selection for `dyn*` goals -- both for dyn unsizing candidates and for built-in object candidates. The former should only be performed on `dyn` objects, but the latter are totally fine. commit 1bb5dd65759218b889f72f39e7b09eef1e389873 Merge: f94a0c91cdd 3ed2b46f286 Author: Matthias Krüger <[email protected]> Date: Thu Jul 6 12:12:11 2023 +0200 Rollup merge of #113246 - mirkootter:fix-compiletest-crash, r=pietroalbini fix compiletest crash When running compiler-tests locally for the `wasm32` platform, one test repeatedly crashed. It does not crash on the CI, only locally. Investigation shows that the `compiletest` itself crashes > panicked-at-attempt-to-subtract-with-overflow ```rust let mut head = replace(bytes, Vec::new()); let mut middle = head.split_off(HEAD_LEN); // The following line will panic let tail = middle.split_off(middle.len() - TAIL_LEN).into_boxed_slice(); let skipped = new_len - HEAD_LEN - TAIL_LEN; ``` The code in question collects the output of a process. Small output is kept completely, but larger output is kept only partially: the first 160 kB and the last 256 kB. The code that performs this split crashes if the data size is less than 416 kB. There is an early out based on the "filtered" length, but it is possible that the filtered length is greater than the real length. It seems that this code was written with the assumption that the filtered length is larger than the real length, which is not true in general. When running CI tests locally using `src/ci/docker/run.sh`, the filtered folder is `/checkout`, which is shorter than the placeholder length of 32 bytes. This PR should not change any behaviour. It only adds an early our for a case which will definitely crash (at least if compiletest is build with integer checks). Note that an early out makes sense here: If the real data is too small, it does not sense to split it. commit f94a0c91cdd7475fbed03adecbb7f2ab7aae2f81 Merge: b112bc5529c ec18a34e1b3 Author: Matthias Krüger <[email protected]> Date: Thu Jul 6 12:12:10 2023 +0200 Rollup merge of #112295 - ForrestOfBarnes:tests-listing-format-json-windows-fix, r=pietroalbini Fix the tests-listing-format-json test on Windows tests/ui/test-attrs/tests-listing-json-format.rs was failing on Windows because each path in the json-formatted output contained "\\\\" instead of "\\". `runtest::TestCx::normalize_output` already checks the compile flags for json-related arguments to handle this case, so I added an equivalent check for the new run flag. commit fc8536669ca9b1a3820da9f29dc01d87a44ee151 Author: Nicholas Nethercote <[email protected]> Date: Thu Jul 6 17:51:18 2023 +1000 Diagnose unsorted CGUs. An assertion failure was reported in #112946. This extra information will help diagnose the problem. commit 4dd1719b3406d80f539d2f49e9842f3563908632 Merge: b112bc5529c deda49e7b7d Author: bors <[email protected]> Date: Thu Jul 6 08:10:42 2023 +0000 Auto merge of #113377 - BoxyUwU:move_ty_ctors_to_ty, r=compiler-errors Move `TyCtxt::mk_x` to `Ty::new_x` where applicable Part of rust-lang/compiler-team#616 turns out there's a lot of places we construct `Ty` this is a ridiculously huge PR :S r? `@oli-obk` commit deda49e7b7df44631720fa94f27a3a430772cd77 Author: Oli Scherer <[email protected]> Date: Thu Jul 6 07:32:08 2023 +0000 Fix up doc links commit 906d2b172c936674b8fbf727c556e5b41df86ef1 Author: Michael Goulet <[email protected]> Date: Thu Jul 6 05:39:39 2023 +0000 Structurally normalize again for byte string lit pat checking commit b112bc5529cfa8d8a9000f7a85278ece3232e579 Merge: 0d50ab77397 4e21e9e039c Author: bors <[email protected]> Date: Thu Jul 6 05:33:54 2023 +0000 Auto merge of #113348 - saethlin:metadata-module-not-compiled, r=Nilstrieb Remove some unnecessary(?) normalization https://github.com/rust-lang/rust/issues/59774#issuecomment-1550966711 commit 3acaa568c25b7ab8cfb08d5b85f638f6baefae14 Author: Michael Goulet <[email protected]> Date: Thu Jul 6 04:48:33 2023 +0000 Prefer object candidates over impl candidates in new selection commit cd26d10edfa8df69266e85b5ab7b991de0a10b38 Author: Michael Goulet <[email protected]> Date: Thu Jul 6 03:10:11 2023 +0000 Dont ICE for `dyn* Trait: Trait` goals during selection in new trait solver commit 0d50ab77397d7278500abd22d34de0e10940b2ee Merge: bd8aabef316 c668eb086e2 Author: bors <[email protected]> Date: Thu Jul 6 02:34:11 2023 +0000 Auto merge of #113391 - fee1-dead-contrib:rollup-9bqlw9z, r=fee1-dead Rollup of 9 pull requests Successful merges: - #111119 (style-guide: Add chapter about formatting for nightly-only syntax) - #112791 (llvm ffi: Expose `CallInst->setTailCallKind`) - #113145 (style-guide: Document newline rules for assignment operators) - #113163 (Add a regression test for #112895) - #113332 (resolve: Use `Interned` for some interned structures) - #113334 (Revert the lexing of `c"…"` string literals) - #113350 (Fix the issue of wrong diagnosis for extern pub fn) - #113371 (Fix submodule handling when the current branch is named after a tag) - #113384 (style-guide: Clarify grammar for small patterns (not a semantic change)) r? `@ghost` `@rustbot` modify labels: rollup commit c668eb086e27985043b060b82d913520fd24612b Merge: 70e8f9d4c01 79df44ba78a Author: fee1-dead <[email protected]> Date: Thu Jul 6 09:20:35 2023 +0800 Rollup merge of #113384 - joshtriplett:style-guide-grammar, r=compiler-errors style-guide: Clarify grammar for small patterns (not a semantic change) The grammar as written feels ambiguous and confusing, in large part because it uses square brackets and commas in the names of non-terminals. Rewrite it to avoid symbols in the names of non-terminals, and to instead wrap terminals in backquotes. Also rename "smallntp" to "small_no_tuple" to make it self-describing. commit 70e8f9d4c01a7293ce1395bf1ad6c84f4432e0e3 Merge: 2bc0ae3f33f 6c7017fa0a4 Author: fee1-dead <[email protected]> Date: Thu Jul 6 09:20:34 2023 +0800 Rollup merge of #113371 - jyn514:submodule-with-tags, r=albertlarsan68 Fix submodule handling when the current branch is named after a tag If: 1. The current branch has the same name as git tag, and 2. The current branch is set to track a remote other than `origin`, and 3. We try to update a submodule then we'll get the following error: ``` ; x c Updating submodule src/doc/reference remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 fatal: 'personal' does not appear to be a git repository fatal: Could not read from remote repository. ``` The problem is that 1. causes `git symbolic-ref --short HEAD` to try and disambiguate the branch from the tag using `heads/branch-name`, which breaks a previous workaround for a bug in `git submodule update` that uses the wrong remote. Adapt the workaround to strip `heads/` from the output. commit 2bc0ae3f33f014f043efecd5b91bb574ea4a855d Merge: 1830b80c2da f25463e8483 Author: fee1-dead <[email protected]> Date: Thu Jul 6 09:20:34 2023 +0800 Rollup merge of #113350 - chenyukang:yukang-fix-113342-parser, r=compiler-errors Fix the issue of wrong diagnosis for extern pub fn Fixes #113342 commit 1830b80c2daf5b03d45ec69289e15b25cee97c7f Merge: 01627265e3e 22fd6a6abf1 Author: fee1-dead <[email protected]> Date: Thu Jul 6 09:20:33 2023 +0800 Rollup merge of #113334 - fmease:revert-lexing-c-str-lits, r=compiler-errors Revert the lexing of `c"…"` string literals Fixes \[after beta-backport\] #113235. Further progress is tracked in #113333. This PR *manually* reverts parts of #108801 (since a git-revert would've been too coarse-grained & messy) and git-reverts #111647. CC `@fee1-dead` (#108801) `@klensy` (#111647) r? `@compiler-errors` `@rustbot` label F-c_str_literals beta-nominated commit 01627265e3e2e84f4fee44ecf8cad892ed72a02a Merge: a105aa227fd 9f3fba8da81 Author: fee1-dead <[email protected]> Date: Thu Jul 6 09:20:32 2023 +0800 Rollup merge of #113332 - petrochenkov:bindintern, r=cjgillot resolve: Use `Interned` for some interned structures Enough to get rid of all existing `ptr::eq`s and "partial" uses of `Interned`. commit a105aa227fd6d82a8f77fe30478c6216d15cd638 Merge: baba9047ebd 40f2fbf61e8 Author: fee1-dead <[email protected]> Date: Thu Jul 6 09:20:32 2023 +0800 Rollup merge of #113163 - JohnTitor:issue-112895, r=compiler-errors Add a regression test for #112895 Closes #112895 if the second option is enough to close the issue r? `@compiler-errors` commit baba9047ebdba3f0555d5c4443f2668a7a1ac0c8 Merge: e461502e06b 03e64f409f6 Author: fee1-dead <[email protected]> Date: Thu Jul 6 09:20:32 2023 +0800 Rollup merge of #113145 - joshtriplett:style-guide-document-assignment-newlines, r=joshtriplett style-guide: Document newline rules for assignment operators The style guide gives general rules for binary operators including assignment, and one of those rules says to put the operator on the subsequent line; the style guide needs to explicitly state the exception of breaking *after* assignment operators rather than before. This is already what rustfmt does and what users do; this fixes the style guide to match the expected default style. commit e461502e06b171c05d4730b4d1a2846a1e5847fa Merge: 6e9bdacaf9e bf5eaa45506 Author: fee1-dead <[email protected]> Date: Thu Jul 6 09:20:31 2023 +0800 Rollup merge of #112791 - WaffleLapkin:wag_the_llvm, r=cuviper llvm ffi: Expose `CallInst->setTailCallKind` This is needed for the explicit tail calls experiment. commit 6e9bdacaf9ec183df9c3027c33775fee868f8435 Merge: d9c13cd4531 5957f028a10 Author: fee1-dead <[email protected]> Date: Thu Jul 6 09:20:30 2023 +0800 Rollup merge of #111119 - compiler-errors:style-nightly, r=joshtriplett style-guide: Add chapter about formatting for nightly-only syntax cc `@rust-lang/style` nightly policy mentioned below is being proposed in https://github.com/rust-lang/style-team/pull/180 commit 3078e4d804f8ed059e3224a2b6f391928f5259e3 Author: Nicholas Nethercote <[email protected]> Date: Thu Jul 6 11:07:22 2023 +1000 Minor comment fix. commit b51169c178a535c8533d21be362c3c4e4d4f0cb7 Author: Nicholas Nethercote <[email protected]> Date: Wed Jul 5 10:03:42 2023 +1000 Remove the field name from `MonoItemPlacement::SingleCgu`. It's needless verbosity. commit 22d4c798ece4f0c9c839325fe279140565a08957 Author: Nicholas Nethercote <[email protected]> Date: Wed Jul 5 07:30:43 2023 +1000 Use `iter()` instead of `iter_mut()` in one place. commit 142075a9fb86e19de36a4583c1bdfed969cca236 Author: Nicholas Nethercote <[email protected]> Date: Tue Jul 4 16:29:05 2023 +1000 Make `UsageMap::get_user_items` infallible. It's nicer this way. commit bd8aabef316bf8779193798eaf35b8749221a9b4 Merge: d9c13cd4531 3dfc7ec05d1 Author: bors <[email protected]> Date: Thu Jul 6 00:00:38 2023 +0000 Auto merge of #113291 - oli-obk:pretty_print_mir_const, r=RalfJung Specialize `try_destructure_mir_constant` for its sole user (pretty printing) We can't remove the query, as we need to invoke it from rustc_middle, but can only implement it in mir interpretation/const eval. r? `@RalfJung` for a first round. While we could move all the logic into pretty printing, that would end up duplicating a bit of code with const eval, which doesn't seem great either. commit 4e21e9e039cd88667d13eaa33603dacbcab1b9b0 Author: Ben Kimock <[email protected]> Date: Tue Jul 4 21:01:10 2023 -0400 Remove some unnecessary normalization commit 12b75fe18b42d6a2995bf86af2c22961d6888b42 Author: Jakub Beránek <[email protected]> Date: Thu Jul 6 00:06:24 2023 +0200 Fix LLVM config path on Windows commit 79df44ba78a10f5ca4cae70d81aa98bfb402e05a Author: Josh Triplett <[email protected]> Date: Wed Jul 5 14:49:59 2023 -0700 style-guide: Rename "smallntp" non-terminal to "small_no_tuple" for clarity The meaning of "smallntp" was not immediately obvious at a glance. Rename it to the self-describing "small_no_tuple" commit cde67f65573f54fa59aa954cea9b4e3504a7a8dd Author: Josh Triplett <[email protected]> Date: Wed Jul 5 14:40:07 2023 -0700 style-guide: Clarify grammar for small patterns (not a semantic change) The grammar as written feels ambiguous and confusing, in large part because it uses square brackets and commas in the names of non-terminals. Rewrite it to avoid symbols in the names of non-terminals, and to instead wrap terminals in backquotes. commit 5957f028a1019f306b131299e6e653d942f809e9 Author: Josh Triplett <[email protected]> Date: Wed Jun 21 17:08:42 2023 -0700 style-guide: Add chapter for nightly formatting Co-authored-by: Michael Goulet <[email protected]> commit 5a6c618d1ab59139b602a3b07572a9fb056c94ec Author: Michael Goulet <[email protected]> Date: Wed May 3 02:56:36 2023 +0000 Clarify that style guide does not cover nightly-only features commit 6ce1c89d64f2f997fc030cf33fcabf8960d012a2 Author: Michael Goulet <[email protected]> Date: Wed Jul 5 13:58:04 2023 -0700 Change comment on `TyCtxt::mk_ty_from_kind` commit d9c13cd4531649c2028a8384cb4d4e54f985380e Merge: 5dac6b320be e1338cc254f Author: bors <[email protected]> Date: Wed Jul 5 20:53:38 2023 +0000 Auto merge of #113287 - RalfJung:miri-test-libstd, r=JohnTitor enable test_join test in Miri Miri for quite a while now has a hack to support self-referential generators: non-`Unique` mutable references are exempt from aliasing conditions. So we can run this test now. (It passes.) Also extend a comment in a Vec test, while I am at it. commit 12138b8e5e840b7446a0893e3cb02a9c05095930 Author: Boxy <[email protected]> Date: Wed Jul 5 20:13:26 2023 +0100 Move `TyCtxt::mk_x` to `Ty::new_x` where applicable commit 40f2fbf61e8daf19a06a237e35e94aafdc649fc7 Author: Yuki Okushi <[email protected]> Date: Thu Jun 29 23:50:42 2023 +0900 Add a regression test for #112895 Signed-off-by: Yuki Okushi <[email protected]> commit 86728e74e043aca318643d0d1bae724f3078bc33 Author: Yuki Okushi <[email protected]> Date: Thu Jun 29 23:55:34 2023 +0900 Add a regression test for #109054 Signed-off-by: Yuki Okushi <[email protected]> commit 3dfc7ec05d1ac233af6f614eaedc67522e20d930 Author: Oli Scherer <[email protected]> Date: Wed Jul 5 16:16:03 2023 +0000 Patch clippy commit 5dac6b320be868f898a3c753934eabc79ff2e406 Merge: e4cd1610067 560136f15d7 Author: bors <[email protected]> Date: Wed Jul 5 16:08:43 2023 +0000 Auto merge of #113370 - compiler-errors:rollup-8gvyy8e, r=compiler-errors Rollup of 8 pull requests Successful merges: - #113010 (rust-installer & rls: remove exclusion from rustfmt & tidy ) - #113317 ( -Ztrait-solver=next: stop depending on old solver) - #113319 (`TypeParameterDefinition` always require a `DefId`) - #113320 (Add some extra information to opaque type cycle errors) - #113321 (Move `ty::ConstKind` to `rustc_type_ir`) - #113337 (Winnow specialized impls during selection in new solver) - #113355 (Move most coverage code out of `rustc_codegen_ssa`) - #113356 (Add support for NetBSD/riscv64 aka. riscv64gc-unknown-netbsd.) r? `@ghost` `@rustbot` modify labels: rollup commit e1e04a8beed95e78b1391c7f4650fb68abd86f8f Author: Oli Scherer <[email protected]> Date: Wed Jul 5 15:58:19 2023 +0000 Document magic boolean commit 6c7017fa0a49f170bbe9d0053b72f996770fdb42 Author: jyn <[email protected]> Date: Wed Jul 5 10:51:34 2023 -0500 Fix submodule handling when the current branch is named after a tag If: 1. The current branch has the same name as git tag, and 2. The current branch is set to track a remote other than `origin`, and 3. We try to update a submodule then we'll get the following error: ``` ; x c Updating submodule src/doc/reference remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 fatal: 'personal' does not appear to be a git repository fatal: Could not read from remote repository. ``` The problem is that 1. causes `git symbolic-ref --short HEAD` to try and disambiguate the branch from the tag using `heads/branch-name`, which breaks a previous workaround for a bug in `git submodule update` that uses the wrong remote. Adapt the workaround to strip `heads/` from the output. commit 8ac1a67d11890d3248ba4b10ff8abe3f465c3afd Author: Oli Scherer <[email protected]> Date: Wed Jul 5 15:51:52 2023 +0000 Name the destructure_mir_constant query appropriately commit 46cce98134a1dd7d8c835b1dfadc891cc9891eb5 Author: Oli Scherer <[email protected]> Date: Wed Jun 28 13:22:02 2023 +0000 Use options instead of errors if the errors are never needed commit 09b89efa70905275dc6abfe17666508127734407 Author: Oli Scherer <[email protected]> Date: Wed Jun 28 09:43:31 2023 +0000 Remove a function argument that is always passed with the same value. commit a0eb348d3828a6332a8372536a008bfbf7585c03 Author: Oli Scherer <[email protected]> Date: Wed Jun 28 09:34:26 2023 +0000 Specialize `DestructuredConstant` to its one user (pretty printing) commit 4dcf988360b52610582deedbb7b6e3f84d5e7dae Author: Oli Scherer <[email protected]> Date: Wed Jun 28 09:23:34 2023 +0000 Specialize `try_destructure_mir_constant` for its sole user commit 560136f15d77af3e16e9db9baafbbfb2b1341450 Merge: 6f9addf6ede 6cc37bbee07 Author: Michael Goulet <[email protected]> Date: Wed Jul 5 08:45:46 2023 -0700 Rollup merge of #113356 - he32:netbsd-riscv64, r=oli-obk Add support for NetBSD/riscv64 aka. riscv64gc-unknown-netbsd. commit 6f9addf6ede748f267a959eb8c734eaa6fc769c7 Merge: c31fe41453c cb570d6bc12 Author: Michael Goulet <[email protected]> Date: Wed Jul 5 08:45:46 2023 -0700 Rollup merge of #113355 - Zalathar:ssa, r=oli-obk Move most coverage code out of `rustc_codegen_ssa` *This is one step in my larger coverage refactoring ambitions described at <https://github.com/rust-lang/compiler-team/issues/645>.* The backend implementation of coverage instrumentation was originally split between SSA and LLVM, perhaps in the hopes that it could be used by other backends. In practice, this split mostly just makes the coverage implementation harder to navigate and harder to modify. It seems unlikely that any backend will actually implement coverage instrumentation in the foreseeable future, especially since many parts of the existing implementation (outside the LLVM backend) are heavily tied to the specific details of LLVM's coverage instrumentation features. The current shared implementation of `codegen_coverage` is heavily tied to the details of `StatementKind::Coverage`, which makes those details difficult to change. I have reason to want to change those details as part of future fixes/improvements, so this will reduce the amount of interface churn caused by those later changes. --- This is intended to be a pure refactoring change, with no changes to actual behaviour. All of the “added” code has really just been moved from other files. commit c31fe41453c0c15192342d06429215694d8fe74e Merge: b2b1a507516 d2a1803d6fa Author: Michael Goulet <[email protected]> Date: Wed Jul 5 08:45:45 2023 -0700 Rollup merge of #113337 - compiler-errors:next-solver-winnow-specializing, r=lcnr Winnow specialized impls during selection in new solver We need to be able to winnow impls that are specialized by more specific impls in order for codegen to be able to proceed. r? ``@lcnr`` commit b2b1a507516c9b6df949e15c5e3590bb8ff9e65b Merge: 0334b64cbba 62174bfe725 Author: Michael Goulet <[email protected]> Date: Wed Jul 5 08:45:45 2023 -0700 Rollup merge of #113321 - BoxyUwU:move_constkind_to_typeir, r=oli-obk Move `ty::ConstKind` to `rustc_type_ir` Needed this in another PR for custom debug impls, and this will also be required to move the new solver into a separate crate that does not use `TyCtxt` so that r-a and friends can depend on the trait solver. Rebased on top of #113325, only the second and third commits needs reviewing commit 0334b64cbba082469d6f473a29d4fc201beb0756 Merge: 5c7a7d9ed44 9e98feb84c3 Author: Michael Goulet <[email protected]> Date: Wed Jul 5 08:45:44 2023 -0700 Rollup merge of #113320 - oli-obk:eval_obligation_query, r=petrochenkov,BoxyUwU Add some extra information to opaque type cycle errors Plus a bunch of cleanups. This should help users debug query cycles due to auto trait checking. We'll probably want to fix cycle errors in most (or all?) cases by looking at the current item's hidden types (new solver does this), and by delaying the auto trait checks to after typeck. commit 5c7a7d9ed44217714403df9b32a9d2d0bcf5c955 Merge: a1f8edb5d5f 594cd84a942 Author: Michael Goulet <[email protected]> Date: Wed Jul 5 08:45:43 2023 -0700 Rollup merge of #113319 - lcnr:type-param-def-def-id, r=compiler-errors `TypeParameterDefinition` always require a `DefId` the `None` case never actually reaches diagnostics so it feels better for diagnostics to be able to rely on the `DefId` being there, cc #113310 commit a1f8edb5d5fe2dfeafdfa3b5777c67fb96c936db Merge: 1cb958a225a 312994243a2 Author: Michael Goulet <[email protected]> Date: Wed Jul 5 08:45:43 2023 -0700 Rollup merge of #113317 - lcnr:sketchy-new-select, r=oli-obk -Ztrait-solver=next: stop depending on old solver removes the final dependencies on the old solver when `-Ztrait-solver=next` is enabled. commit 1cb958a225af2aa93135e0c38b89bf16c59a2fcc Merge: dfe0683138d d5dbe867f62 Author: Michael Goulet <[email protected]> Date: Wed Jul 5 08:45:42 2023 -0700 Rollup merge of #113010 - klensy:ri-rls-fmt, r=ozkanonur rust-installer & rls: remove exclusion from rustfmt & tidy <strike>based on #112884</strike> `rust-installer` and `rls` no longer submodules, but not removed from exclude list for rustfmt and tidy, preventing running fmt and lints on them. commit fd7f53112ab688ac6e6aa9d1b049fac45945552a Author: jyn <[email protected]> Date: Wed Jul 5 10:33:43 2023 -0500 Update compiler-builtins to 0.1.95 This pulls in the new `outline-atomics` intrinsics. commit 6cc37bbee074bb2746d8cfe4456c1d88f7db5c2f Author: Havard Eidnes <[email protected]> Date: Wed Jul 5 10:34:26 2023 +0000 Add support for NetBSD/riscv64 aka. riscv64gc-unknown-netbsd. commit e4cd1610067501fa4d347eba7b18f77137dbbf48 Merge: dfe0683138d 25fc6c15869 Author: bors <[email protected]> Date: Wed Jul 5 13:42:00 2023 +0000 Auto merge of #113210 - fee1-dead-contrib:effects-mvp, r=oli-obk Effects/keyword generics MVP This adds `feature(effects)`, which adds `const host: bool` to the generics of const functions, const traits and const impls. This will be used to replace the current logic around const traits. r? `@oli-obk` commit 22fd6a6abf1f97b488278cd142cc7fe721beb92a Author: León Orell Valerian Liehr <[email protected]> Date: Tue Jul 4 20:37:17 2023 +0200 Add regression test commit 3788b7ab32a6398e7563557f7b32f741f43704a3 Author: León Orell Valerian Liehr <[email protected]> Date: Tue Jul 4 19:53:44 2023 +0200 Revert "use new c literals instead of cstr! macro" This reverts commit a17561ffc90c900cb7d0e96b00c6381244764ef7. commit 9dbe67fc8c722bc8df4a6a792677a93a073773f4 Author: León Orell Valerian Liehr <[email protected]> Date: Tue Jul 4 19:45:58 2023 +0200 Revert "use c literals in library" This reverts commit f212ba6d6d60963c8101bb24fc3e53fca80c046f. commit 5b25f9d8bdb4a5ffdaed4fb6ebdc521c6eba1b0f Author: León Orell Valerian Liehr <[email protected]> Date: Tue Jul 4 19:45:55 2023 +0200 Revert "fix ptr cast" This reverts commit 2f459f7f140307b5abbb7ea81440ed1843b490e7. commit c6643b50ea7290daf0a9f0e33d1f27c6f52796ce Author: León Orell Valerian Liehr <[email protected]> Date: Tue Jul 4 19:40:48 2023 +0200 Revert the lexing of c_str_literals commit dfe0683138de0959b6ab6a039b54d9347f6a6355 Merge: 99f7d368c0e 9e5f61fcdd2 Author: bors <[email protected]> Date: Wed Jul 5 11:04:17 2023 +0000 Auto merge of #112594 - ChrisDenton:process=-kill, r=Amanieu Return `Ok` on kill if process has already exited This will require an FCP from `@rust-lang/libs-api.` Fixes #112423. See that issue for more details. commit 9f3fba8da81300dc1a734a9cb1e2d804286b4f8d Author: Vadim Petrochenkov <[email protected]> Date: Wed Jul 5 13:46:42 2023 +0300 resolve: Add comments explaining use of `Interned` commit c1f412f9a93cee5bfd4c4cbdf0e0cb78fc51da2c Author: Vadim Petrochenkov <[email protected]> Date: Tue Jul 4 20:00:42 2023 +0300 resolve: Use `Interned` for `Module` commit 4abdaeb67eb3aa85941cee4928b75dbcbd120148 Author: Vadim Petrochenkov <[email protected]> Date: Tue Jul 4 18:51:35 2023 +0300 resolve: Use `Interned` for `Import` commit 8efd9cc30dd04cb4e58d9c0420f9ae88e5850f4e Author: Vadim Petrochenkov <[email protected]> Date: Tue Jul 4 17:28:57 2023 +0300 resolve: Use `Interned` for `NameBinding` commit cb570d6bc1251f32a07d8ce173dc735be78a325f Author: Zalathar <[email protected]> Date: Wed Jul 5 18:04:58 2023 +1000 Move `coverageinfo::ffi` and `coverageinfo::map` out of SSA commit 9c430d38cf10ec3fab459be00e87057e5cce55b0 Author: Zalathar <[email protected]> Date: Wed Jul 5 17:56:10 2023 +1000 Remove trait `CoverageInfoMethods`, since non-LLVM backends don't need it These methods are only ever called from within `rustc_codegen_llvm`, so they can just be declared there as well. commit 4169d0f756dde8b3e692610bddb3c948c5cd53ea Author: Zalathar <[email protected]> Date: Wed Jul 5 17:39:40 2023 +1000 Narrow trait `CoverageInfoBuilderMethods` down to just one method This effectively inlines most of `FunctionCx::codegen_coverage` into the LLVM implementation of `CoverageInfoBuilderMethods`. commit 9e5f61fcdd29936938d401c0f0055b9af32caf5c Author: Chris Denton <[email protected]> Date: Wed Jul 5 09:54:16 2023 +0100 Workaround for old android not having echo commit 99f7d368c0ed753db797ee82e89b5a2b7e49509a Merge: 6dab6dc5fcd f80aec7429e Author: bors <[email protected]> Date: Wed Jul 5 08:48:04 2023 +0000 Auto merge of #112319 - oli-obk:assoc_ty_sized_bound_for_object_safety2, …
trvswgnr
added a commit
to crablang/crab
that referenced
this pull request
Jul 9, 2023
commit 03247fbbe87b28a991d721c4fe7cdf4e6fc5d5a3 Merge: 83964c156db 8a08a2954e8 Author: bors <[email protected]> Date: Sun Jul 9 01:55:53 2023 +0000 Auto merge of #113485 - Mark-Simulacrum:bump-version, r=Mark-Simulacrum Bump version to 1.73 r? `@Mark-Simulacrum` commit 83964c156db1f444050a38b2498dbd0da6d5d503 Merge: d1389b9b489 de9b9c833b5 Author: bors <[email protected]> Date: Sat Jul 8 20:56:57 2023 +0000 Auto merge of #113491 - matthiaskrgr:rollup-mueqz7h, r=matthiaskrgr Rollup of 6 pull requests Successful merges: - #113005 (Don't call `query_normalize` when reporting similar impls) - #113064 (std: edit [T]::swap docs) - #113138 (Add release notes for 1.71.0) - #113217 (resolve typerelative ctors to adt) - #113254 (Use consistent formatting in Readme) - #113482 (Migrate GUI colors test to original CSS color format) r? `@ghost` `@rustbot` modify labels: rollup commit de9b9c833b5e39f4d364b1047de9743f7ff03e13 Merge: dd8322876e8 50b4d1f4134 Author: Matthias Krüger <[email protected]> Date: Sat Jul 8 20:53:30 2023 +0200 Rollup merge of #113482 - GuillaumeGomez:migrate-gui-test-color-20, r=notriddle Migrate GUI colors test to original CSS color format Follow-up of https://github.com/rust-lang/rust/pull/111459. r? ``@notriddle`` commit dd8322876e85938a6e92551299e27ebc5ef177e6 Merge: b637be7a17b 7bb9de87f66 Author: Matthias Krüger <[email protected]> Date: Sat Jul 8 20:53:30 2023 +0200 Rollup merge of #113254 - atouchet:rd3, r=Mark-Simulacrum Use consistent formatting in Readme commit b637be7a17be5c5a3b7bb45ff481e8f3705a91a2 Merge: 14aeef369c1 261c0231232 Author: Matthias Krüger <[email protected]> Date: Sat Jul 8 20:53:29 2023 +0200 Rollup merge of #113217 - ericmarkmartin:lower-type-relative-ctor-to-adt, r=cjgillot resolve typerelative ctors to adt Associated issue: #110508 r? ``@spastorino`` commit 14aeef369c103159acd7e7aead6f3d0d0fd1d3f7 Merge: 8c562996dd2 a30f797437e Author: Matthias Krüger <[email protected]> Date: Sat Jul 8 20:53:28 2023 +0200 Rollup merge of #113138 - cuviper:relnotes-1.71.0, r=Mark-Simulacrum Add release notes for 1.71.0 r? ``@Mark-Simulacrum`` cc ``@rust-lang/release`` commit 8c562996dd2247422adec450b0dbcd2c55a737f1 Merge: 48a0d038fa7 30c61eece4c Author: Matthias Krüger <[email protected]> Date: Sat Jul 8 20:53:27 2023 +0200 Rollup merge of #113064 - marcospb19:add-note-in-vec-swap-docs, r=Mark-Simulacrum std: edit [T]::swap docs Add a note about what happens when index arguments are equal. commit 48a0d038fa7659c199c97095877a320b62d09ddf Merge: 4353b1ecd65 2c33dfea765 Author: Matthias Krüger <[email protected]> Date: Sat Jul 8 20:53:27 2023 +0200 Rollup merge of #113005 - compiler-errors:dont-query-normalize, r=cjgillot Don't call `query_normalize` when reporting similar impls Firstly, It's sketchy to be using `query_normalize` at all during HIR typeck -- it's asking for an ICE 😅. Secondly, we're normalizing an impl trait ref that potentially has parameter types in `ty::ParamEnv::empty()`, which is kinda sketchy as well. The only UI test change from removing this normalization is that we don't evaluate anonymous constants in impls, which end up giving us really ugly suggestions: ``` error[E0277]: the trait bound `[X; 35]: Default` is not satisfied --> /home/gh-compiler-errors/test.rs:4:5 | 4 | <[X; 35] as Default>::default(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Default` is not implemented for `[X; 35]` | = help: the following other types implement trait `Default`: &[T] &mut [T] [T; 32] [T; core::::array::{impl#30}::{constant#0}] [T; core::::array::{impl#31}::{constant#0}] [T; core::::array::{impl#32}::{constant#0}] [T; core::::array::{impl#33}::{constant#0}] [T; core::::array::{impl#34}::{constant#0}] and 27 others ``` So just fold the impls with a `BottomUpFolder` that calls `ty::Const::eval`. This doesn't work totally correctly with generic-const-exprs, but it's fine for stable code, and this is error reporting after all. commit d1389b9b4895e52ec7d1859a2d86e96babfb5d76 Merge: 4353b1ecd65 39f558f8cf0 Author: bors <[email protected]> Date: Sat Jul 8 18:36:58 2023 +0000 Auto merge of #113484 - matthiaskrgr:rollup-goq2u0d, r=matthiaskrgr Rollup of 7 pull requests Successful merges: - #112931 (Enable zlib in LLVM on aarch64-apple-darwin) - #113158 (tests: unset `RUSTC_LOG_COLOR` in a test) - #113173 (CI: include workflow name in concurrency group) - #113335 (Reveal opaques in new solver) - #113390 (CGU formation tweaks) - #113399 (Structurally normalize again for byte string lit pat checking) - #113412 (Add basic types to SMIR) r? `@ghost` `@rustbot` modify labels: rollup commit 4353b1ecd65d493c9f503aacff07a3f98d0b0340 Merge: 9bb6fbe2619 d8c29b82c97 Author: bors <[email protected]> Date: Sat Jul 8 16:12:28 2023 +0000 Auto merge of #113450 - Nilstrieb:src/bootstrap/test.rs, r=flip1995 Fail the build if clippy tests don't pass This was removed in https://github.com/rust-lang/rust/pull/113260/commits/de69d556eb5006a21f868b8c12d48f0ef1308a5a#diff-8479eab02701e686aedb15b567dc8fc31220c6e4efb9565ccc9d662b7fee2214 which caused CI to ignore clippy failures. This adds back the exit, which should cause CI to fail again if a test is broken (like right now, as clippy tests are broken on master). Also see https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/CI.20doesn't.20care.20about.20clippy.20test.20failures.20but.20only.20sometime r? flip1995 commit d8c29b82c9732087881da93a429431e5f2da346d Author: Nilstrieb <[email protected]> Date: Sat Jul 8 17:17:40 2023 +0200 Delete `to_string_in_format_args_incremental.rs` It fails CI and passes locally. It passes random directores in `-Cincremental` so maybe something's up. It shouldn't block us here. commit c80333edfb584e054b7ac337cca6d98f59c507ba Author: Nilstrieb <[email protected]> Date: Fri Jul 7 19:06:47 2023 +0200 Fail the build if clippy tests don't pass This was removed in https://github.com/rust-lang/rust/pull/113260/commits/de69d556eb5006a21f868b8c12d48f0ef1308a5a#diff-8479eab02701e686aedb15b567dc8fc31220c6e4efb9565ccc9d662b7fee2214 which caused CI to ignore clippy failures. This adds back the exit, which should cause CI to fail again if a test is broken (like right now, as clippy tests are broken on master). commit 8a08a2954e8d6c5f584816241dc414bc09863fe8 Author: Mark Rousskov <[email protected]> Date: Sat Jul 8 10:35:49 2023 -0400 Bump version commit 39f558f8cf0174493ed6c81de11ec372de3d0849 Merge: 8dc9461c91b 9ca51b92d4a Author: Matthias Krüger <[email protected]> Date: Sat Jul 8 15:49:47 2023 +0200 Rollup merge of #113412 - spastorino:smir-types-1, r=oli-obk Add basic types to SMIR Still incomplete but I think this can be merged and we can keep iterating over it. r? ``@oli-obk`` commit 8dc9461c91b84521933ad7e93fc79ce1d28d6491 Merge: d5b1ef98b07 906d2b172c9 Author: Matthias Krüger <[email protected]> Date: Sat Jul 8 15:49:47 2023 +0200 Rollup merge of #113399 - compiler-errors:next-solver-byte-pat-again, r=oli-obk Structurally normalize again for byte string lit pat checking We need to structurally normalize the pointee of a match scrutinee when trying to match byte string patterns -- we used[^1] to call `structurally_resolve_type`, which errors for type vars[^2], but lcnr added `try_structurally_resolve_type`[^3] in the mean time, which is the right thing to use here since it's totally opportunistic. Fixes rust-lang/trait-system-refactor-initiative#38 [^1]: #112428 [^2]: #112993 [^3]: #113086 commit d5b1ef98b07ebdf41b9c6ec50252d51ed206c795 Merge: f3f1b0394d5 3078e4d804f Author: Matthias Krüger <[email protected]> Date: Sat Jul 8 15:49:46 2023 +0200 Rollup merge of #113390 - nnethercote:cgu-tweaks, r=wesleywiser CGU formation tweaks Minor improvements I found while trying out something bigger that didn't work out. r? ``@wesleywiser`` commit f3f1b0394d5aae12855dad5a5c35ceaefb8d40fc Merge: e0b290f1a8d f55b046931c Author: Matthias Krüger <[email protected]> Date: Sat Jul 8 15:49:46 2023 +0200 Rollup merge of #113335 - compiler-errors:reveal-opaques-in-new-solver, r=lcnr Reveal opaques in new solver We were testing against the wrong reveal mode :fearful: Also a couple of misc commits that I don't want to really put in separate prs r? ``@lcnr`` commit e0b290f1a8dfd2cf6dbad94c0425f04f387842d1 Merge: b70c5538b6c f88024627b8 Author: Matthias Krüger <[email protected]> Date: Sat Jul 8 15:49:45 2023 +0200 Rollup merge of #113173 - Kobzol:ci-concurrency-group-workflow, r=pietroalbini CI: include workflow name in concurrency group Currently, this won't change anything, because we only have one relevant workflow (`CI`), but for future proofing we should probably include the workflow name in the concurrency group. Found by ``@klensy`` [here](https://github.com/rust-lang/rust/pull/113059#discussion_r1247213606). commit b70c5538b6ceaa60a2fad44d1753f101b71e5584 Merge: 3e03a48c18c 181d7b463ba Author: Matthias Krüger <[email protected]> Date: Sat Jul 8 15:49:45 2023 +0200 Rollup merge of #113158 - davidtwco:unset-rustc-log-color-in-test, r=wesleywiser tests: unset `RUSTC_LOG_COLOR` in a test Setting `RUSTC_LOG_COLOR=always` is sometimes useful if tools that one pipes `RUSTC_LOG` into support coloured output, but it makes this test fail because it has a `.stderr` file with `WARN` log output. commit 3e03a48c18c4465380dca49a41add1609c09d2d8 Merge: ce519c5945c d43131b5c82 Author: Matthias Krüger <[email protected]> Date: Sat Jul 8 15:49:44 2023 +0200 Rollup merge of #112931 - cbeuw:apple-zlib, r=Mark-Simulacrum Enable zlib in LLVM on aarch64-apple-darwin Works on macOS 13.4, Xcode version 14.3.1.0.1.1683849156 This was disabled in #75500 on Apple Silicon Developer Transition Kit, but Apple appears to have fixed their zlib now commit 9bb6fbe26198e58b517bfbf58a3348fad98d1654 Merge: ce519c5945c 2beabbbf6fd Author: bors <[email protected]> Date: Sat Jul 8 13:48:30 2023 +0000 Auto merge of #113376 - Nilstrieb:pointer-coercions-are-not-casts-because-that-sounds-way-to-general-aaaa, r=oli-obk Rename `adjustment::PointerCast` and variants using it to `PointerCoercion` It makes it sounds like the `ExprKind` and `Rvalue` are supposed to represent all pointer related casts, when in reality their just used to share a little enum variants. Make it clear there these are only coercions and that people who see this and think "why are so many pointer related casts not in these variants" aren't insane. This enum was added in #59987. I'm not sure whether the variant sharing is actually worth it, but this at least makes it less confusing. r? oli-obk commit 50b4d1f4134f91354ed71e6e08d91f21015a626b Author: Guillaume Gomez <[email protected]> Date: Sat Jul 8 14:55:50 2023 +0200 Migrate GUI colors test to original CSS color format commit ce519c5945c90596cf429dc2a91c846daeb75cd1 Merge: d4096e0412a 7a22c7e6f4a Author: bors <[email protected]> Date: Sat Jul 8 10:46:29 2023 +0000 Auto merge of #113474 - compiler-errors:rollup-07x1up7, r=compiler-errors Rollup of 8 pull requests Successful merges: - #113413 (Add needs-triage to all new issues) - #113426 (Don't ICE in `resolve_bound_vars` when associated return-type bounds are in bad positions) - #113427 (Remove `variances_of` on RPITIT GATs, remove its one use-case) - #113441 (miri: check that assignments do not self-overlap) - #113453 (Remove unused from_method from rustc_on_unimplemented) - #113456 (Avoid calling report_forbidden_specialization for RPITITs) - #113466 (Update cargo) - #113467 (Fix comment of `fn_can_unwind`) r? `@ghost` `@rustbot` modify labels: rollup commit 7a22c7e6f4a18e0dd3427ce2c3c8bf4cda882ad3 Merge: 083b2d409c6 39c3ef799f4 Author: Michael Goulet <[email protected]> Date: Fri Jul 7 22:12:19 2023 -0700 Rollup merge of #113467 - nbdd0121:unwind, r=compiler-errors Fix comment of `fn_can_unwind` Reopen of #113213 commit 083b2d409c67ed3361b46e5e065dc8bd767cd4c7 Merge: cf1f8c55d56 b9a4cfe05ee Author: Michael Goulet <[email protected]> Date: Fri Jul 7 22:12:18 2023 -0700 Rollup merge of #113466 - weihanglo:update-cargo, r=weihanglo Update cargo 1 commits in 5b377cece0e0dd0af686cf53ce4637d5d85c2a10..45782b6b8afd1da042d45c2daeec9c0744f72cc7 2023-06-30 00:01:00 +0000 to 2023-07-05 16:54:51 +0000 - docs(ref): Provide guidance on version requirements (rust-lang/cargo#12323) r? ``@ghost`` commit cf1f8c55d565b3da83d4ed2ca635400481f081a6 Merge: 37a05d80544 24326ee5081 Author: Michael Goulet <[email protected]> Date: Fri Jul 7 22:12:18 2023 -0700 Rollup merge of #113456 - spastorino:new-rpitit-31, r=compiler-errors Avoid calling report_forbidden_specialization for RPITITs Fixes #113438 r? ``@compiler-errors`` commit 37a05d8054447c1d439cca6e2f1938d51905de53 Merge: 2b78119671b 6d80879ab99 Author: Michael Goulet <[email protected]> Date: Fri Jul 7 22:12:17 2023 -0700 Rollup merge of #113453 - spastorino:new-rpitit-30, r=compiler-errors Remove unused from_method from rustc_on_unimplemented Fixes #113439 `on_unimplemented_note` was calling `item_name` for RPITITs and that produced ICEs. I've added a regression test for that but also have removed `from_method` symbol entirely because it wasn't even used and by doing that the `item_name` call was also removed. r? ``@compiler-errors`` commit 2b78119671bf35346a8f570e574724ae90537938 Merge: 751dcaceb43 7a83ef82da9 Author: Michael Goulet <[email protected]> Date: Fri Jul 7 22:12:17 2023 -0700 Rollup merge of #113441 - RalfJung:assign-no-overlap, r=oli-obk miri: check that assignments do not self-overlap r? `````@oli-obk````` commit 751dcaceb432139bbff9513866c73ca6d3996e56 Merge: a13b57e6363 ca8202d429b Author: Michael Goulet <[email protected]> Date: Fri Jul 7 22:12:16 2023 -0700 Rollup merge of #113427 - compiler-errors:no-variances-of-rpitit-gat, r=spastorino Remove `variances_of` on RPITIT GATs, remove its one use-case It doesn't make sense to implement variances on a GAT anyways, since we don't relate GATs with variance: https://github.com/rust-lang/rust/blob/85bf07972a1041b9e25393b803d0e006bec3eaaf/compiler/rustc_middle/src/ty/relate.rs#L569-L579 r? ``@spastorino`` commit a13b57e636354c6bc926c710500873fe73ddab04 Merge: 77a6c7f3a16 b7191d8388a Author: Michael Goulet <[email protected]> Date: Fri Jul 7 22:12:16 2023 -0700 Rollup merge of #113426 - compiler-errors:rtn-in-impl-header, r=fee1-dead Don't ICE in `resolve_bound_vars` when associated return-type bounds are in bad positions I couldn't find a better way to avoid hitting this ICE, so let's just delay it. The problem is that we really shouldn't even be *trying* to visit associated type bounds in `resolve_bound_vars` when they show up in impl headers, but we don't have enough context to do this. Fixes #113423 commit 77a6c7f3a16910878f3d03e52f6638ab276d3008 Merge: eee6b31c0c3 a118ce2176c Author: Michael Goulet <[email protected]> Date: Fri Jul 7 22:12:15 2023 -0700 Rollup merge of #113413 - Nilstrieb:this-needs-some-triaging, r=albertlarsan68 Add needs-triage to all new issues Closes #113261 The label: https://github.com/rust-lang/rust/labels/needs-triage commit d4096e0412ac5de785d739a0aa2b1c1c7b9d3b7d Merge: eee6b31c0c3 c3004a7b652 Author: bors <[email protected]> Date: Sat Jul 8 03:22:54 2023 +0000 Auto merge of #112652 - oli-obk:tait_only_in_sig, r=compiler-errors Require TAITs to be mentioned in the signatures of functions that register hidden types for them r? `@lcnr` `@compiler-errors` This implements the lang team decision from [the TAIT design meeting](https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/design.20meeting.202023-05-31.20TAITs/near/362518164). commit eee6b31c0c3b7c3ad8733957eaa122ae1a07e299 Merge: cb80ff132a0 cedcd39cfd3 Author: bors <[email protected]> Date: Sat Jul 8 00:01:19 2023 +0000 Auto merge of #113455 - Alexendoo:clippy-tests, r=Nilstrieb Fix failing clippy tests Comments out the C string literals due to https://github.com/rust-lang/rust/pull/113334 Fixes https://github.com/rust-lang/rust-clippy/issues/11121 Opened against `rust-lang/rust` in order to unblock https://github.com/rust-lang/rust/pull/113450 r? `@Nilstrieb` commit b9a4cfe05ee5f082351c71572451641a2f6e345c Author: Weihang Lo <[email protected]> Date: Fri Jul 7 23:17:40 2023 +0100 Update cargo commit b7191d8388abfb7c66b5fea9120cdf07c640edfa Author: Michael Goulet <[email protected]> Date: Thu Jul 6 22:40:55 2023 +0000 Don't ICE in resolve_bound_vars when associated return-type bounds are in bad positions commit 24326ee5081a28628f0046d25764408b7bf4e2ca Author: Santiago Pastorino <[email protected]> Date: Fri Jul 7 15:24:10 2023 -0300 Avoid calling report_forbidden_specialization for RPITITs commit 6d80879ab991b47880410da62167a54c097275e8 Author: Santiago Pastorino <[email protected]> Date: Fri Jul 7 15:58:25 2023 -0300 Add regression test for RPITITs commit 3aec8d4227e3bd7ac14cfd93c990223e3f868229 Author: Santiago Pastorino <[email protected]> Date: Fri Jul 7 15:57:30 2023 -0300 Remove unused from_method symbol commit cedcd39cfd31946112f0a1f5c77ec58451893f6d Author: Alex Macleod <[email protected]> Date: Fri Jul 7 18:18:25 2023 +0000 Fix failing clippy tests Comments out the C string literals due to https://github.com/rust-lang/rust/pull/113334 Fixes https://github.com/rust-lang/rust-clippy/issues/11121 commit 9ca51b92d4a056d22d3b3d22e54bbb29ed205a40 Author: Santiago Pastorino <[email protected]> Date: Wed Jul 5 19:30:24 2023 -0300 Add Float ty to SMIR commit 42eccffce3e950e95d9e965d4dd58ecb44633d55 Author: Santiago Pastorino <[email protected]> Date: Wed Jul 5 19:26:52 2023 -0300 Add Uint ty to SMIR commit 458ead41d621a6aacdf0d27169a4aa9d1ff54f98 Author: Santiago Pastorino <[email protected]> Date: Wed Jul 5 19:06:49 2023 -0300 Add Int ty to SMIR commit 73e816e37ce028274d603ab33d8717d35dc9e914 Author: Santiago Pastorino <[email protected]> Date: Wed Jul 5 19:01:11 2023 -0300 Add Char ty to SMIR commit 61adcaf87b605f1b2d73f62cda813329cb448807 Author: Santiago Pastorino <[email protected]> Date: Wed Jul 5 18:50:13 2023 -0300 Add rustc_ty_to_ty basic tests commit 2beabbbf6fd0ccbd986920ad1650b39081c1eaaa Author: Nilstrieb <[email protected]> Date: Wed Jul 5 20:07:03 2023 +0200 Rename `adjustment::PointerCast` and variants using it to `PointerCoercion` It makes it sound like the `ExprKind` and `Rvalue` are supposed to represent all pointer related casts, when in reality their just used to share a some enum variants. Make it clear there these are only coercion to make it clear why only some pointer related "casts" are in the enum. commit f55b046931cfa1b281375ff8ec4e590d8386f0c4 Author: Michael Goulet <[email protected]> Date: Tue Jul 4 18:49:13 2023 +0000 Normalize opaques during codegen in new solver commit 713f9bb5d1d1d6cb22bc668e326d1c0f0f4f815a Author: Michael Goulet <[email protected]> Date: Tue Jul 4 17:54:23 2023 +0000 Mark more hanging new-solver tests commit 010ee7b0e09c0b1eb6ba7bc745693bd19c9d37e4 Author: Michael Goulet <[email protected]> Date: Tue Jul 4 17:36:26 2023 +0000 Remove an AFIT test that isn't an AFIT test commit cb80ff132a0e9aa71529b701427e4e6c243b58df Merge: fd68a6ded95 7aa5f39d3b5 Author: bors <[email protected]> Date: Fri Jul 7 15:42:29 2023 +0000 Auto merge of #113245 - lukas-code:unsizing-sanity-check, r=the8472 sanity check field offsets in unsizeable structs As promised in https://github.com/rust-lang/rust/pull/112062#issuecomment-1567494994, this PR extends the layout sanity checks to ensure that structs fields don't move around when unsizing and prevent issues like https://github.com/rust-lang/rust/issues/112048 in the future. Like most other layout sanity checks, this only runs on compilers with debug assertions enabled. Here is how it looks when it fails: ```text error: internal compiler error: compiler/rustc_ty_utils/src/layout.rs:533:21: unsizing GcNode<std::boxed::Box<i32>> changed field order! Layout { size: Size(32 bytes), align: AbiAndPrefAlign { abi: Align(8 bytes), pref: Align(8 bytes) }, abi: Aggregate { sized: true }, fields: Arbitrary { offsets: [Size(0 bytes), Size(8 bytes), Size(24 bytes)], memory_index: [0, 1, 2] }, largest_niche: Some(Niche { offset: Size(24 bytes), value: Pointer(AddressSpace(0)), valid_range: 1..=18446744073709551615 }), variants: Single { index: 0 } } Layout { size: Size(24 bytes), align: AbiAndPrefAlign { abi: Align(8 bytes), pref: Align(8 bytes) }, abi: Aggregate { sized: false }, fields: Arbitrary { offsets: [Size(16 bytes), Size(0 bytes), Size(24 bytes)], memory_index: [1, 0, 2] }, largest_niche: None, variants: Single { index: 0 } } ``` r? `@the8472` commit 7a83ef82da92d81be83d430602778f4f4c8fb439 Author: Ralf Jung <[email protected]> Date: Fri Jul 7 16:54:44 2023 +0200 miri: check that assignments do not self-overlap commit c3004a7b6523bfe939df0f73b49f63510557e735 Author: Oli Scherer <[email protected]> Date: Thu Jun 29 13:32:37 2023 +0000 Treat closures as part of their parent commit b549ba1bd4313990d164bc7152e61aefd68eeacd Author: Oli Scherer <[email protected]> Date: Thu Jun 29 07:52:45 2023 +0000 Fix one layer of closures not being able to constrain opaque types commit ef52dc7bb8c14c5663773f70e1353fd53131261c Author: Oli Scherer <[email protected]> Date: Thu Jun 29 07:47:29 2023 +0000 Add regression test commit dcacfe7395cae68ecf8f8efe6803a121f4b74e99 Author: Oli Scherer <[email protected]> Date: Thu Jun 29 07:24:04 2023 +0000 Only match on the `DefKind` once. commit 18f3d8658815f260909b3485b20baa16ffbddde9 Author: Oli Scherer <[email protected]> Date: Thu Jun 29 07:23:11 2023 +0000 Collect nested items immediately instead of collecting them into an intermediate `Vec` first commit b07d27c81e0d40c41c26ea37c19eb61211c76095 Author: Oli Scherer <[email protected]> Date: Thu Jun 29 07:19:06 2023 +0000 Move some logic into a method on `OpaqueTypeCollector` commit af9dcf70be6a7d14619275c9b2d8beebd0743b29 Author: Oli Scherer <[email protected]> Date: Thu Jun 29 07:15:27 2023 +0000 Remove one layer of nested matching on the same thing commit a3ca139defd6f4d93d8f19e7c73a5c94965cca4f Author: Oli Scherer <[email protected]> Date: Thu Jun 29 07:02:29 2023 +0000 liar liar find_taits_declared_in_body on fire commit 2f89c963d3777e03d0ff9f0bcfc11b148a4c0af7 Author: Oli Scherer <[email protected]> Date: Mon Jun 26 17:50:11 2023 +0000 We don't need to track binders if we aren't normalizing commit 907f97e4111b1e52cef13203ec4515449ab4ae59 Author: Oli Scherer <[email protected]> Date: Mon Jun 26 17:49:35 2023 +0000 Remove normalization from `opaque_types_defined_by` commit fd68a6ded951bd7b852ab8107007f7145e3ad6ec Merge: 1a449dcfd25 37fea342ea2 Author: bors <[email protected]> Date: Fri Jul 7 13:15:11 2023 +0000 Auto merge of #113437 - workingjubilee:sync-simd-2023-july-07, r=workingjubilee Sync portable-simd to 2023 July 07 r? `@ghost` commit 4c99872efe97c8e6183dfc9b729bc3a2903ac40b Author: Oli Scherer <[email protected]> Date: Thu Jun 15 09:41:14 2023 +0000 Require TAITs to be mentioned in the signatures of functions that register hidden types for them commit 37fea342ea26bb7042a6acdf683c8210eb2172ff Author: Jubilee Young <[email protected]> Date: Fri Jul 7 04:33:08 2023 -0700 Use new std::simd fn in miri tests Old fn were slightly divergent. commit 8765f9172750111e0b7af489561fba0e2ef22007 Merge: 7cc3da05f99 7c7dbe0c505 Author: Jubilee Young <[email protected]> Date: Fri Jul 7 04:07:00 2023 -0700 Sync portable-simd to 2023 July 07 Sync up to rust-lang/portable-simd@7c7dbe0c505ccbc02ff30c1e37381ab1d47bf46f commit 7c7dbe0c505ccbc02ff30c1e37381ab1d47bf46f Author: Jubilee Young <[email protected]> Date: Fri Jul 7 04:03:54 2023 -0700 Remove unused import commit 789c38fae2f81985dac3c5181bc888a363ac781e Author: Jubilee <[email protected]> Date: Fri Jul 7 03:49:42 2023 -0700 Fixed cast imports in doctest (rust-lang/portable-simd#355) commit f2f9bd7eb178bb19ba2f935903cf4de95b3952f5 Author: Jubilee Young <[email protected]> Date: Fri Jul 7 03:32:29 2023 -0700 Disable MIPS jobs in CI commit 1a449dcfd25143f7e1f6b6f5ddf1c12af361e2ff Merge: 921f669749a 3f8919c09bb Author: bors <[email protected]> Date: Fri Jul 7 10:32:42 2023 +0000 Auto merge of #113308 - compiler-errors:poly-select, r=lcnr Split `SelectionContext::select` into fns that take a binder and don't *most* usages of `SelectionContext::select` don't need to use a binder, but wrap them in a dummy because of the signature. Let's split this out into `SelectionContext::{select,poly_select}` and limit the usages of the latter. Right now, we only have 3 places where we're calling `poly_select` -- fulfillment, internally within the old solver, and the auto-trait finder. r? `@lcnr` commit 2b55e03436d58d0335baaa2ec344914ecc49e0df Merge: 73d7eb5f73b eb0041d1545 Author: Jubilee <[email protected]> Date: Fri Jul 7 03:21:10 2023 -0700 Merge pull request #353 from rust-lang/sync-upstream-2023-06-07 Sync upstream commit 921f669749a57ab5936721fdd93b2da57b581381 Merge: 7cc3da05f99 7916a2c1c9e Author: bors <[email protected]> Date: Fri Jul 7 08:04:48 2023 +0000 Auto merge of #113270 - the8472:opt-macro-tts, r=nnethercote perform TokenStream replacement in-place when possible in expand_macro commit 7cc3da05f99fbc89782fc6cb7e207fa11aa6add5 Merge: bb548f96457 45cb1ba9d30 Author: bors <[email protected]> Date: Fri Jul 7 05:28:17 2023 +0000 Auto merge of #113429 - compiler-errors:rollup-wkv4w9a, r=compiler-errors Rollup of 8 pull requests Successful merges: - #111917 (Simplify duplicate checks for mir validator) - #112008 (Fix incorrect documented default bufsize in bufreader/writer) - #112825 (Don't call `type_of` on TAIT in defining scope in new solver) - #113164 (Add a regression test for #109054) - #113318 (Revert "alloc: Allow comparing Boxs over different allocators", add regression test) - #113397 (Prefer object candidates in new selection) - #113419 (Avoid calling item_name for RPITIT) - #113421 (Do not assert >1 RPITITs on collect_return_position_impl_trait_in_trait_tys) r? `@ghost` `@rustbot` modify labels: rollup commit 45cb1ba9d30452fc332fa28bdda06ac86e80fe25 Merge: 901c8636443 07a230b5a58 Author: Michael Goulet <[email protected]> Date: Thu Jul 6 20:11:41 2023 -0700 Rollup merge of #113421 - spastorino:new-rpitit-29, r=compiler-errors Do not assert >1 RPITITs on collect_return_position_impl_trait_in_trait_tys Fixes #113403 Assert on collect_return_position_impl_trait_in_trait_tys is not correct when we call it from type_of(GAT). The included test is an example of a situation that collector collects 0 types. r? `@compiler-errors` commit 901c86364431f62dbe3f88936e2eeb0d48e43fd8 Merge: f1c90985e87 c0c155137b7 Author: Michael Goulet <[email protected]> Date: Thu Jul 6 20:11:41 2023 -0700 Rollup merge of #113419 - spastorino:new-rpitit-28, r=compiler-errors Avoid calling item_name for RPITIT Fixes #113405 r? `@compiler-errors` commit f1c90985e87f2b144b065b4383ab56657749c372 Merge: 7913d76cb9b 3acaa568c25 Author: Michael Goulet <[email protected]> Date: Thu Jul 6 20:11:40 2023 -0700 Rollup merge of #113397 - compiler-errors:new-select-prefer-obj, r=lcnr Prefer object candidates in new selection `dyn Any` shouldn't be using [this implementation](https://doc.rust-lang.org/std/any/trait.Any.html#impl-Any-for-T) during codegen. Prefer object candidates over other candidates, except for other object candidates. commit 7913d76cb9be2c8a61cbda3833373b81f0a7d736 Merge: 1cb31e71d62 a635bf7a3ba Author: Michael Goulet <[email protected]> Date: Thu Jul 6 20:11:40 2023 -0700 Rollup merge of #113318 - tgross35:113283-allocator-trait-eq, r=m-ou-se Revert "alloc: Allow comparing Boxs over different allocators", add regression test Temporary fix for #113283 Adds a test to fix the regression introduced in 001b081cc1b and revert that commit. The test fails without the revert. commit 1cb31e71d626ee82ebe1a0d0c97dae79649871d3 Merge: de49a9f2f51 86728e74e04 Author: Michael Goulet <[email protected]> Date: Thu Jul 6 20:11:39 2023 -0700 Rollup merge of #113164 - JohnTitor:issue-109054, r=compiler-errors Add a regression test for #109054 Closes #109054 r? ``@compiler-errors`` commit de49a9f2f51757dced984a1b7f45e38d59985b5e Merge: 75febc6ed65 388c230cf77 Author: Michael Goulet <[email protected]> Date: Thu Jul 6 20:11:39 2023 -0700 Rollup merge of #112825 - compiler-errors:tait-defining-cycle, r=lcnr Don't call `type_of` on TAIT in defining scope in new solver It's *never* productive to call `consider_auto_trait_candidate` on a TAIT in the defining scope, since it will always lead to a query cycle since we call `type_of` on the TAIT. So let's just don't. I've reserved this behavior just to `SolverMode::Normal` just to avoid any future problems, since this is *technically* incomplete since we're discarding a candidate that could *theoretically* apply. But given such candidate assembly *always* leads to a query cycle, I think it's relatively low risk, and I could be convinced otherwise and make this apply to both solver mode. I assume it's far less likely to be encountered in coherence, though. This is much more likely to encounter in the new solver, though it can also be encountered in the old solver too, so I'm happy to discuss whether this new behavior we even want in the first place... I encountered this in a couple of failing UI tests: * `tests/ui/type-alias-impl-trait/issue-62000-associate-impl-trait-lifetimes.rs` * `tests/ui/type-alias-impl-trait/issue-93411.rs` r? `@lcnr` commit 75febc6ed65c50f949264d7fa3be7be89fee0407 Merge: 3aa45619238 5488a64654d Author: Michael Goulet <[email protected]> Date: Thu Jul 6 20:11:38 2023 -0700 Rollup merge of #112008 - intruder-kat:master, r=Nilstrieb Fix incorrect documented default bufsize in bufreader/writer commit 3aa456192381cb072da69991d67b19651a81a104 Merge: 06082086b42 cdaef2c435f Author: Michael Goulet <[email protected]> Date: Thu Jul 6 20:11:38 2023 -0700 Rollup merge of #111917 - WaffleLapkin:validate_unalloc, r=oli-obk Simplify duplicate checks for mir validator This removes unnecessary allocations & is less code. commit bb548f964572f7fe652716f5897d9050a31c936e Merge: 06082086b42 462c5c4f3a9 Author: bors <[email protected]> Date: Fri Jul 7 03:02:54 2023 +0000 Auto merge of #112816 - Amanieu:llvm-riscv-arch, r=cuviper Update LLVM submodule This adds https://github.com/rust-lang/llvm-project/pull/147. commit ca8202d429b1d9513d154445774191cd17f39833 Author: Michael Goulet <[email protected]> Date: Fri Jul 7 02:29:57 2023 +0000 Remove variances_of on RPITIT gats, remove its one use-case commit 06082086b42629adee0d37e4e67aa1816a447e23 Merge: 85bf07972a1 e1153590354 Author: bors <[email protected]> Date: Fri Jul 7 00:39:47 2023 +0000 Auto merge of #112796 - Kobzol:ci-merge-msvc-cargo-tools, r=pietroalbini CI: merge msvc cargo and tools jobs The `x86_64-msvc-cargo` and `x86_64-msvc-tools` jobs both run for ~1 hour, but most of that time is actually spent in building LLVM and `rustc`, so I want to try merging them. ![image](https://github.com/rust-lang/rust/assets/4539057/8652fa2a-b8b7-41d0-8f16-555d31acd9a5) commit 388c230cf77c633eeb9eee2e5388ce957c69797b Author: Michael Goulet <[email protected]> Date: Wed Jun 28 17:41:04 2023 +0000 Don't call type_of on TAIT in defining scope in new solver commit 07a230b5a5819d9a0bcfdf77bec8e9d4d9ba1ea9 Author: Santiago Pastorino <[email protected]> Date: Thu Jul 6 16:40:50 2023 -0300 Do not assert >1 RPITITs on collect_return_position_impl_trait_in_trait_tys commit c0c155137b7a80452213ffbf991c52b0faa5025b Author: Santiago Pastorino <[email protected]> Date: Thu Jul 6 16:18:24 2023 -0300 Avoid calling item_name for RPITIT commit 85bf07972a1041b9e25393b803d0e006bec3eaaf Merge: 87c8c83ec73 fd7f53112ab Author: bors <[email protected]> Date: Thu Jul 6 18:58:54 2023 +0000 Auto merge of #113269 - jyn514:update-compiler-builtins, r=Amanieu Update compiler builtins cc https://github.com/rust-lang/compiler-builtins/pull/532#discussion_r1249354225 in particular this pulls in https://github.com/rust-lang/compiler-builtins/pull/532 and https://github.com/rust-lang/compiler-builtins/pull/535. Fixes https://github.com/rust-lang/rust/issues/93166. Fixes https://github.com/rust-lang/git2-rs/issues/706. Fixes https://github.com/rust-lang/rust/issues/109064. Fixes https://github.com/rust-lang/wg-cargo-std-aware/issues/74. commit 284df9fc34ffb5d1e746c31902cbd1982144b45b Author: Santiago Pastorino <[email protected]> Date: Wed Jun 28 11:31:28 2023 -0300 Wrap SMIR bool and tuple into a Rigid variant commit 3f8919c09bbf78b6d1d48fbbacbd63ad5a78cf7a Author: Michael Goulet <[email protected]> Date: Tue Jul 4 01:18:31 2023 +0000 get rid of a bit more calls to poly_select commit 018c3e2c092d73d18169729c4dde92c29924d9d8 Author: Michael Goulet <[email protected]> Date: Mon Jul 3 22:35:28 2023 +0000 Coercion doesn't need binders either commit 52f738499534a2d048a418c37cf4639b8b235bdb Author: Michael Goulet <[email protected]> Date: Mon Jul 3 22:23:37 2023 +0000 Separate select calls that don't need a binder commit 36453456cb2d9d1630aa0a5c68dc7ed9243b5ed4 Author: Michael Goulet <[email protected]> Date: Mon Jul 3 21:42:31 2023 +0000 TraitObligation -> PolyTraitObligation commit 87c8c83ec73eb0dd42e255f82813afa3dde24a57 Merge: c4c84df3b34 0c147d53455 Author: bors <[email protected]> Date: Thu Jul 6 16:14:50 2023 +0000 Auto merge of #112779 - Kobzol:ci-merge-llvm-14, r=pietroalbini CI: merge x86_64-gnu-llvm-14 and x86_64-gnu-llvm-14-stage1 CI jobs Another attempt to shorten CI job times. Suggested by `@the8472` [here](https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/CI.20usage/near/367172221). commit a118ce2176c69f8b982e99f643e8d8135f4f3c94 Author: Nilstrieb <[email protected]> Date: Thu Jul 6 17:57:03 2023 +0200 Add needs-triage to all new issues Closes #113261 commit 7aa5f39d3b55eb746d9d64244ed5343874807ac4 Author: Lukas Markeffsky <@> Date: Wed Jul 5 20:44:24 2023 +0200 add helper methods for accessing struct tail commit e3de14e46396694e48bfecf963fe9fa8e8a90d86 Author: Lukas Markeffsky <@> Date: Sun Jul 2 14:07:08 2023 +0200 sanity check field offsets in unsizeable structs commit 478071ba9daabcdbc880db5638989dc16545537c Author: Lukas Markeffsky <@> Date: Sun Jul 2 14:06:56 2023 +0200 clean up struct layout code commit c4c84df3b34a84506e16093fb4b9ac5cac1ee75a Merge: 4b6749b21e6 12b75fe18b4 Author: bors <[email protected]> Date: Thu Jul 6 13:01:13 2023 +0000 Auto merge of #113323 - Kobzol:pgo-script-llvm-ci, r=jyn514 Use `llvm-config` instead of `download-ci-llvm` in PGO script This should avoid CI breakage when the LLVM stamp is updated, and also it will avoid an unnecessary LLVM download from CI. r? `@jyn514` commit 4b6749b21e680a6280cf05ace533ae20c93d9bff Merge: 4dd1719b340 a7532d92789 Author: bors <[email protected]> Date: Thu Jul 6 10:29:49 2023 +0000 Auto merge of #113406 - matthiaskrgr:rollup-0rprs5k, r=matthiaskrgr Rollup of 4 pull requests Successful merges: - #112295 (Fix the tests-listing-format-json test on Windows) - #113246 (fix compiletest crash) - #113395 (Dont ICE for `dyn* Trait: Trait` (built-in object) goals during selection in new trait solver) - #113402 (Diagnose unsorted CGUs.) r? `@ghost` `@rustbot` modify labels: rollup commit a7532d9278961f5f6188a3a3f525034408812920 Merge: 72e0e177d58 fc8536669ca Author: Matthias Krüger <[email protected]> Date: Thu Jul 6 12:12:12 2023 +0200 Rollup merge of #113402 - nnethercote:diagnose-unsorted-CGUs, r=lqd Diagnose unsorted CGUs. An assertion failure was reported in #112946. This extra information will help diagnose the problem. r? `@lqd` commit 72e0e177d583cb9bd3879e0776e01291ec7563d3 Merge: 1bb5dd65759 cd26d10edfa Author: Matthias Krüger <[email protected]> Date: Thu Jul 6 12:12:12 2023 +0200 Rollup merge of #113395 - compiler-errors:new-solver-dyn-star-selection, r=oli-obk Dont ICE for `dyn* Trait: Trait` (built-in object) goals during selection in new trait solver We were ICEing too eagerly during selection for `dyn*` goals -- both for dyn unsizing candidates and for built-in object candidates. The former should only be performed on `dyn` objects, but the latter are totally fine. commit 1bb5dd65759218b889f72f39e7b09eef1e389873 Merge: f94a0c91cdd 3ed2b46f286 Author: Matthias Krüger <[email protected]> Date: Thu Jul 6 12:12:11 2023 +0200 Rollup merge of #113246 - mirkootter:fix-compiletest-crash, r=pietroalbini fix compiletest crash When running compiler-tests locally for the `wasm32` platform, one test repeatedly crashed. It does not crash on the CI, only locally. Investigation shows that the `compiletest` itself crashes > panicked-at-attempt-to-subtract-with-overflow ```rust let mut head = replace(bytes, Vec::new()); let mut middle = head.split_off(HEAD_LEN); // The following line will panic let tail = middle.split_off(middle.len() - TAIL_LEN).into_boxed_slice(); let skipped = new_len - HEAD_LEN - TAIL_LEN; ``` The code in question collects the output of a process. Small output is kept completely, but larger output is kept only partially: the first 160 kB and the last 256 kB. The code that performs this split crashes if the data size is less than 416 kB. There is an early out based on the "filtered" length, but it is possible that the filtered length is greater than the real length. It seems that this code was written with the assumption that the filtered length is larger than the real length, which is not true in general. When running CI tests locally using `src/ci/docker/run.sh`, the filtered folder is `/checkout`, which is shorter than the placeholder length of 32 bytes. This PR should not change any behaviour. It only adds an early our for a case which will definitely crash (at least if compiletest is build with integer checks). Note that an early out makes sense here: If the real data is too small, it does not sense to split it. commit f94a0c91cdd7475fbed03adecbb7f2ab7aae2f81 Merge: b112bc5529c ec18a34e1b3 Author: Matthias Krüger <[email protected]> Date: Thu Jul 6 12:12:10 2023 +0200 Rollup merge of #112295 - ForrestOfBarnes:tests-listing-format-json-windows-fix, r=pietroalbini Fix the tests-listing-format-json test on Windows tests/ui/test-attrs/tests-listing-json-format.rs was failing on Windows because each path in the json-formatted output contained "\\\\" instead of "\\". `runtest::TestCx::normalize_output` already checks the compile flags for json-related arguments to handle this case, so I added an equivalent check for the new run flag. commit fc8536669ca9b1a3820da9f29dc01d87a44ee151 Author: Nicholas Nethercote <[email protected]> Date: Thu Jul 6 17:51:18 2023 +1000 Diagnose unsorted CGUs. An assertion failure was reported in #112946. This extra information will help diagnose the problem. commit 4dd1719b3406d80f539d2f49e9842f3563908632 Merge: b112bc5529c deda49e7b7d Author: bors <[email protected]> Date: Thu Jul 6 08:10:42 2023 +0000 Auto merge of #113377 - BoxyUwU:move_ty_ctors_to_ty, r=compiler-errors Move `TyCtxt::mk_x` to `Ty::new_x` where applicable Part of rust-lang/compiler-team#616 turns out there's a lot of places we construct `Ty` this is a ridiculously huge PR :S r? `@oli-obk` commit deda49e7b7df44631720fa94f27a3a430772cd77 Author: Oli Scherer <[email protected]> Date: Thu Jul 6 07:32:08 2023 +0000 Fix up doc links commit 906d2b172c936674b8fbf727c556e5b41df86ef1 Author: Michael Goulet <[email protected]> Date: Thu Jul 6 05:39:39 2023 +0000 Structurally normalize again for byte string lit pat checking commit b112bc5529cfa8d8a9000f7a85278ece3232e579 Merge: 0d50ab77397 4e21e9e039c Author: bors <[email protected]> Date: Thu Jul 6 05:33:54 2023 +0000 Auto merge of #113348 - saethlin:metadata-module-not-compiled, r=Nilstrieb Remove some unnecessary(?) normalization https://github.com/rust-lang/rust/issues/59774#issuecomment-1550966711 commit 3acaa568c25b7ab8cfb08d5b85f638f6baefae14 Author: Michael Goulet <[email protected]> Date: Thu Jul 6 04:48:33 2023 +0000 Prefer object candidates over impl candidates in new selection commit cd26d10edfa8df69266e85b5ab7b991de0a10b38 Author: Michael Goulet <[email protected]> Date: Thu Jul 6 03:10:11 2023 +0000 Dont ICE for `dyn* Trait: Trait` goals during selection in new trait solver commit 0d50ab77397d7278500abd22d34de0e10940b2ee Merge: bd8aabef316 c668eb086e2 Author: bors <[email protected]> Date: Thu Jul 6 02:34:11 2023 +0000 Auto merge of #113391 - fee1-dead-contrib:rollup-9bqlw9z, r=fee1-dead Rollup of 9 pull requests Successful merges: - #111119 (style-guide: Add chapter about formatting for nightly-only syntax) - #112791 (llvm ffi: Expose `CallInst->setTailCallKind`) - #113145 (style-guide: Document newline rules for assignment operators) - #113163 (Add a regression test for #112895) - #113332 (resolve: Use `Interned` for some interned structures) - #113334 (Revert the lexing of `c"…"` string literals) - #113350 (Fix the issue of wrong diagnosis for extern pub fn) - #113371 (Fix submodule handling when the current branch is named after a tag) - #113384 (style-guide: Clarify grammar for small patterns (not a semantic change)) r? `@ghost` `@rustbot` modify labels: rollup commit c668eb086e27985043b060b82d913520fd24612b Merge: 70e8f9d4c01 79df44ba78a Author: fee1-dead <[email protected]> Date: Thu Jul 6 09:20:35 2023 +0800 Rollup merge of #113384 - joshtriplett:style-guide-grammar, r=compiler-errors style-guide: Clarify grammar for small patterns (not a semantic change) The grammar as written feels ambiguous and confusing, in large part because it uses square brackets and commas in the names of non-terminals. Rewrite it to avoid symbols in the names of non-terminals, and to instead wrap terminals in backquotes. Also rename "smallntp" to "small_no_tuple" to make it self-describing. commit 70e8f9d4c01a7293ce1395bf1ad6c84f4432e0e3 Merge: 2bc0ae3f33f 6c7017fa0a4 Author: fee1-dead <[email protected]> Date: Thu Jul 6 09:20:34 2023 +0800 Rollup merge of #113371 - jyn514:submodule-with-tags, r=albertlarsan68 Fix submodule handling when the current branch is named after a tag If: 1. The current branch has the same name as git tag, and 2. The current branch is set to track a remote other than `origin`, and 3. We try to update a submodule then we'll get the following error: ``` ; x c Updating submodule src/doc/reference remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 fatal: 'personal' does not appear to be a git repository fatal: Could not read from remote repository. ``` The problem is that 1. causes `git symbolic-ref --short HEAD` to try and disambiguate the branch from the tag using `heads/branch-name`, which breaks a previous workaround for a bug in `git submodule update` that uses the wrong remote. Adapt the workaround to strip `heads/` from the output. commit 2bc0ae3f33f014f043efecd5b91bb574ea4a855d Merge: 1830b80c2da f25463e8483 Author: fee1-dead <[email protected]> Date: Thu Jul 6 09:20:34 2023 +0800 Rollup merge of #113350 - chenyukang:yukang-fix-113342-parser, r=compiler-errors Fix the issue of wrong diagnosis for extern pub fn Fixes #113342 commit 1830b80c2daf5b03d45ec69289e15b25cee97c7f Merge: 01627265e3e 22fd6a6abf1 Author: fee1-dead <[email protected]> Date: Thu Jul 6 09:20:33 2023 +0800 Rollup merge of #113334 - fmease:revert-lexing-c-str-lits, r=compiler-errors Revert the lexing of `c"…"` string literals Fixes \[after beta-backport\] #113235. Further progress is tracked in #113333. This PR *manually* reverts parts of #108801 (since a git-revert would've been too coarse-grained & messy) and git-reverts #111647. CC `@fee1-dead` (#108801) `@klensy` (#111647) r? `@compiler-errors` `@rustbot` label F-c_str_literals beta-nominated commit 01627265e3e2e84f4fee44ecf8cad892ed72a02a Merge: a105aa227fd 9f3fba8da81 Author: fee1-dead <[email protected]> Date: Thu Jul 6 09:20:32 2023 +0800 Rollup merge of #113332 - petrochenkov:bindintern, r=cjgillot resolve: Use `Interned` for some interned structures Enough to get rid of all existing `ptr::eq`s and "partial" uses of `Interned`. commit a105aa227fd6d82a8f77fe30478c6216d15cd638 Merge: baba9047ebd 40f2fbf61e8 Author: fee1-dead <[email protected]> Date: Thu Jul 6 09:20:32 2023 +0800 Rollup merge of #113163 - JohnTitor:issue-112895, r=compiler-errors Add a regression test for #112895 Closes #112895 if the second option is enough to close the issue r? `@compiler-errors` commit baba9047ebdba3f0555d5c4443f2668a7a1ac0c8 Merge: e461502e06b 03e64f409f6 Author: fee1-dead <[email protected]> Date: Thu Jul 6 09:20:32 2023 +0800 Rollup merge of #113145 - joshtriplett:style-guide-document-assignment-newlines, r=joshtriplett style-guide: Document newline rules for assignment operators The style guide gives general rules for binary operators including assignment, and one of those rules says to put the operator on the subsequent line; the style guide needs to explicitly state the exception of breaking *after* assignment operators rather than before. This is already what rustfmt does and what users do; this fixes the style guide to match the expected default style. commit e461502e06b171c05d4730b4d1a2846a1e5847fa Merge: 6e9bdacaf9e bf5eaa45506 Author: fee1-dead <[email protected]> Date: Thu Jul 6 09:20:31 2023 +0800 Rollup merge of #112791 - WaffleLapkin:wag_the_llvm, r=cuviper llvm ffi: Expose `CallInst->setTailCallKind` This is needed for the explicit tail calls experiment. commit 6e9bdacaf9ec183df9c3027c33775fee868f8435 Merge: d9c13cd4531 5957f028a10 Author: fee1-dead <[email protected]> Date: Thu Jul 6 09:20:30 2023 +0800 Rollup merge of #111119 - compiler-errors:style-nightly, r=joshtriplett style-guide: Add chapter about formatting for nightly-only syntax cc `@rust-lang/style` nightly policy mentioned below is being proposed in https://github.com/rust-lang/style-team/pull/180 commit 3078e4d804f8ed059e3224a2b6f391928f5259e3 Author: Nicholas Nethercote <[email protected]> Date: Thu Jul 6 11:07:22 2023 +1000 Minor comment fix. commit b51169c178a535c8533d21be362c3c4e4d4f0cb7 Author: Nicholas Nethercote <[email protected]> Date: Wed Jul 5 10:03:42 2023 +1000 Remove the field name from `MonoItemPlacement::SingleCgu`. It's needless verbosity. commit 22d4c798ece4f0c9c839325fe279140565a08957 Author: Nicholas Nethercote <[email protected]> Date: Wed Jul 5 07:30:43 2023 +1000 Use `iter()` instead of `iter_mut()` in one place. commit 142075a9fb86e19de36a4583c1bdfed969cca236 Author: Nicholas Nethercote <[email protected]> Date: Tue Jul 4 16:29:05 2023 +1000 Make `UsageMap::get_user_items` infallible. It's nicer this way. commit bd8aabef316bf8779193798eaf35b8749221a9b4 Merge: d9c13cd4531 3dfc7ec05d1 Author: bors <[email protected]> Date: Thu Jul 6 00:00:38 2023 +0000 Auto merge of #113291 - oli-obk:pretty_print_mir_const, r=RalfJung Specialize `try_destructure_mir_constant` for its sole user (pretty printing) We can't remove the query, as we need to invoke it from rustc_middle, but can only implement it in mir interpretation/const eval. r? `@RalfJung` for a first round. While we could move all the logic into pretty printing, that would end up duplicating a bit of code with const eval, which doesn't seem great either. commit 4e21e9e039cd88667d13eaa33603dacbcab1b9b0 Author: Ben Kimock <[email protected]> Date: Tue Jul 4 21:01:10 2023 -0400 Remove some unnecessary normalization commit 12b75fe18b42d6a2995bf86af2c22961d6888b42 Author: Jakub Beránek <[email protected]> Date: Thu Jul 6 00:06:24 2023 +0200 Fix LLVM config path on Windows commit 79df44ba78a10f5ca4cae70d81aa98bfb402e05a Author: Josh Triplett <[email protected]> Date: Wed Jul 5 14:49:59 2023 -0700 style-guide: Rename "smallntp" non-terminal to "small_no_tuple" for clarity The meaning of "smallntp" was not immediately obvious at a glance. Rename it to the self-describing "small_no_tuple" commit cde67f65573f54fa59aa954cea9b4e3504a7a8dd Author: Josh Triplett <[email protected]> Date: Wed Jul 5 14:40:07 2023 -0700 style-guide: Clarify grammar for small patterns (not a semantic change) The grammar as written feels ambiguous and confusing, in large part because it uses square brackets and commas in the names of non-terminals. Rewrite it to avoid symbols in the names of non-terminals, and to instead wrap terminals in backquotes. commit 5957f028a1019f306b131299e6e653d942f809e9 Author: Josh Triplett <[email protected]> Date: Wed Jun 21 17:08:42 2023 -0700 style-guide: Add chapter for nightly formatting Co-authored-by: Michael Goulet <[email protected]> commit 5a6c618d1ab59139b602a3b07572a9fb056c94ec Author: Michael Goulet <[email protected]> Date: Wed May 3 02:56:36 2023 +0000 Clarify that style guide does not cover nightly-only features commit 6ce1c89d64f2f997fc030cf33fcabf8960d012a2 Author: Michael Goulet <[email protected]> Date: Wed Jul 5 13:58:04 2023 -0700 Change comment on `TyCtxt::mk_ty_from_kind` commit d9c13cd4531649c2028a8384cb4d4e54f985380e Merge: 5dac6b320be e1338cc254f Author: bors <[email protected]> Date: Wed Jul 5 20:53:38 2023 +0000 Auto merge of #113287 - RalfJung:miri-test-libstd, r=JohnTitor enable test_join test in Miri Miri for quite a while now has a hack to support self-referential generators: non-`Unique` mutable references are exempt from aliasing conditions. So we can run this test now. (It passes.) Also extend a comment in a Vec test, while I am at it. commit 12138b8e5e840b7446a0893e3cb02a9c05095930 Author: Boxy <[email protected]> Date: Wed Jul 5 20:13:26 2023 +0100 Move `TyCtxt::mk_x` to `Ty::new_x` where applicable commit 40f2fbf61e8daf19a06a237e35e94aafdc649fc7 Author: Yuki Okushi <[email protected]> Date: Thu Jun 29 23:50:42 2023 +0900 Add a regression test for #112895 Signed-off-by: Yuki Okushi <[email protected]> commit 86728e74e043aca318643d0d1bae724f3078bc33 Author: Yuki Okushi <[email protected]> Date: Thu Jun 29 23:55:34 2023 +0900 Add a regression test for #109054 Signed-off-by: Yuki Okushi <[email protected]> commit 3dfc7ec05d1ac233af6f614eaedc67522e20d930 Author: Oli Scherer <[email protected]> Date: Wed Jul 5 16:16:03 2023 +0000 Patch clippy commit 5dac6b320be868f898a3c753934eabc79ff2e406 Merge: e4cd1610067 560136f15d7 Author: bors <[email protected]> Date: Wed Jul 5 16:08:43 2023 +0000 Auto merge of #113370 - compiler-errors:rollup-8gvyy8e, r=compiler-errors Rollup of 8 pull requests Successful merges: - #113010 (rust-installer & rls: remove exclusion from rustfmt & tidy ) - #113317 ( -Ztrait-solver=next: stop depending on old solver) - #113319 (`TypeParameterDefinition` always require a `DefId`) - #113320 (Add some extra information to opaque type cycle errors) - #113321 (Move `ty::ConstKind` to `rustc_type_ir`) - #113337 (Winnow specialized impls during selection in new solver) - #113355 (Move most coverage code out of `rustc_codegen_ssa`) - #113356 (Add support for NetBSD/riscv64 aka. riscv64gc-unknown-netbsd.) r? `@ghost` `@rustbot` modify labels: rollup commit e1e04a8beed95e78b1391c7f4650fb68abd86f8f Author: Oli Scherer <[email protected]> Date: Wed Jul 5 15:58:19 2023 +0000 Document magic boolean commit 6c7017fa0a49f170bbe9d0053b72f996770fdb42 Author: jyn <[email protected]> Date: Wed Jul 5 10:51:34 2023 -0500 Fix submodule handling when the current branch is named after a tag If: 1. The current branch has the same name as git tag, and 2. The current branch is set to track a remote other than `origin`, and 3. We try to update a submodule then we'll get the following error: ``` ; x c Updating submodule src/doc/reference remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 fatal: 'personal' does not appear to be a git repository fatal: Could not read from remote repository. ``` The problem is that 1. causes `git symbolic-ref --short HEAD` to try and disambiguate the branch from the tag using `heads/branch-name`, which breaks a previous workaround for a bug in `git submodule update` that uses the wrong remote. Adapt the workaround to strip `heads/` from the output. commit 8ac1a67d11890d3248ba4b10ff8abe3f465c3afd Author: Oli Scherer <[email protected]> Date: Wed Jul 5 15:51:52 2023 +0000 Name the destructure_mir_constant query appropriately commit 46cce98134a1dd7d8c835b1dfadc891cc9891eb5 Author: Oli Scherer <[email protected]> Date: Wed Jun 28 13:22:02 2023 +0000 Use options instead of errors if the errors are never needed commit 09b89efa70905275dc6abfe17666508127734407 Author: Oli Scherer <[email protected]> Date: Wed Jun 28 09:43:31 2023 +0000 Remove a function argument that is always passed with the same value. commit a0eb348d3828a6332a8372536a008bfbf7585c03 Author: Oli Scherer <[email protected]> Date: Wed Jun 28 09:34:26 2023 +0000 Specialize `DestructuredConstant` to its one user (pretty printing) commit 4dcf988360b52610582deedbb7b6e3f84d5e7dae Author: Oli Scherer <[email protected]> Date: Wed Jun 28 09:23:34 2023 +0000 Specialize `try_destructure_mir_constant` for its sole user commit 560136f15d77af3e16e9db9baafbbfb2b1341450 Merge: 6f9addf6ede 6cc37bbee07 Author: Michael Goulet <[email protected]> Date: Wed Jul 5 08:45:46 2023 -0700 Rollup merge of #113356 - he32:netbsd-riscv64, r=oli-obk Add support for NetBSD/riscv64 aka. riscv64gc-unknown-netbsd. commit 6f9addf6ede748f267a959eb8c734eaa6fc769c7 Merge: c31fe41453c cb570d6bc12 Author: Michael Goulet <[email protected]> Date: Wed Jul 5 08:45:46 2023 -0700 Rollup merge of #113355 - Zalathar:ssa, r=oli-obk Move most coverage code out of `rustc_codegen_ssa` *This is one step in my larger coverage refactoring ambitions described at <https://github.com/rust-lang/compiler-team/issues/645>.* The backend implementation of coverage instrumentation was originally split between SSA and LLVM, perhaps in the hopes that it could be used by other backends. In practice, this split mostly just makes the coverage implementation harder to navigate and harder to modify. It seems unlikely that any backend will actually implement coverage instrumentation in the foreseeable future, especially since many parts of the existing implementation (outside the LLVM backend) are heavily tied to the specific details of LLVM's coverage instrumentation features. The current shared implementation of `codegen_coverage` is heavily tied to the details of `StatementKind::Coverage`, which makes those details difficult to change. I have reason to want to change those details as part of future fixes/improvements, so this will reduce the amount of interface churn caused by those later changes. --- This is intended to be a pure refactoring change, with no changes to actual behaviour. All of the “added” code has really just been moved from other files. commit c31fe41453c0c15192342d06429215694d8fe74e Merge: b2b1a507516 d2a1803d6fa Author: Michael Goulet <[email protected]> Date: Wed Jul 5 08:45:45 2023 -0700 Rollup merge of #113337 - compiler-errors:next-solver-winnow-specializing, r=lcnr Winnow specialized impls during selection in new solver We need to be able to winnow impls that are specialized by more specific impls in order for codegen to be able to proceed. r? ``@lcnr`` commit b2b1a507516c9b6df949e15c5e3590bb8ff9e65b Merge: 0334b64cbba 62174bfe725 Author: Michael Goulet <[email protected]> Date: Wed Jul 5 08:45:45 2023 -0700 Rollup merge of #113321 - BoxyUwU:move_constkind_to_typeir, r=oli-obk Move `ty::ConstKind` to `rustc_type_ir` Needed this in another PR for custom debug impls, and this will also be required to move the new solver into a separate crate that does not use `TyCtxt` so that r-a and friends can depend on the trait solver. Rebased on top of #113325, only the second and third commits needs reviewing commit 0334b64cbba082469d6f473a29d4fc201beb0756 Merge: 5c7a7d9ed44 9e98feb84c3 Author: Michael Goulet <[email protected]> Date: Wed Jul 5 08:45:44 2023 -0700 Rollup merge of #113320 - oli-obk:eval_obligation_query, r=petrochenkov,BoxyUwU Add some extra information to opaque type cycle errors Plus a bunch of cleanups. This should help users debug query cycles due to auto trait checking. We'll probably want to fix cycle errors in most (or all?) cases by looking at the current item's hidden types (new solver does this), and by delaying the auto trait checks to after typeck. commit 5c7a7d9ed44217714403df9b32a9d2d0bcf5c955 Merge: a1f8edb5d5f 594cd84a942 Author: Michael Goulet <[email protected]> Date: Wed Jul 5 08:45:43 2023 -0700 Rollup merge of #113319 - lcnr:type-param-def-def-id, r=compiler-errors `TypeParameterDefinition` always require a `DefId` the `None` case never actually reaches diagnostics so it feels better for diagnostics to be able to rely on the `DefId` being there, cc #113310 commit a1f8edb5d5fe2dfeafdfa3b5777c67fb96c936db Merge: 1cb958a225a 312994243a2 Author: Michael Goulet <[email protected]> Date: Wed Jul 5 08:45:43 2023 -0700 Rollup merge of #113317 - lcnr:sketchy-new-select, r=oli-obk -Ztrait-solver=next: stop depending on old solver removes the final dependencies on the old solver when `-Ztrait-solver=next` is enabled. commit 1cb958a225af2aa93135e0c38b89bf16c59a2fcc Merge: dfe0683138d d5dbe867f62 Author: Michael Goulet <[email protected]> Date: Wed Jul 5 08:45:42 2023 -0700 Rollup merge of #113010 - klensy:ri-rls-fmt, r=ozkanonur rust-installer & rls: remove exclusion from rustfmt & tidy <strike>based on #112884</strike> `rust-installer` and `rls` no longer submodules, but not removed from exclude list for rustfmt and tidy, preventing running fmt and lints on them. commit fd7f53112ab688ac6e6aa9d1b049fac45945552a Author: jyn <[email protected]> Date: Wed Jul 5 10:33:43 2023 -0500 Update compiler-builtins to 0.1.95 This pulls in the new `outline-atomics` intrinsics. commit 6cc37bbee074bb2746d8cfe4456c1d88f7db5c2f Author: Havard Eidnes <[email protected]> Date: Wed Jul 5 10:34:26 2023 +0000 Add support for NetBSD/riscv64 aka. riscv64gc-unknown-netbsd. commit e4cd1610067501fa4d347eba7b18f77137dbbf48 Merge: dfe0683138d 25fc6c15869 Author: bors <[email protected]> Date: Wed Jul 5 13:42:00 2023 +0000 Auto merge of #113210 - fee1-dead-contrib:effects-mvp, r=oli-obk Effects/keyword generics MVP This adds `feature(effects)`, which adds `const host: bool` to the generics of const functions, const traits and const impls. This will be used to replace the current logic around const traits. r? `@oli-obk` commit 22fd6a6abf1f97b488278cd142cc7fe721beb92a Author: León Orell Valerian Liehr <[email protected]> Date: Tue Jul 4 20:37:17 2023 +0200 Add regression test commit 3788b7ab32a6398e7563557f7b32f741f43704a3 Author: León Orell Valerian Liehr <[email protected]> Date: Tue Jul 4 19:53:44 2023 +0200 Revert "use new c literals instead of cstr! macro" This reverts commit a17561ffc90c900cb7d0e96b00c6381244764ef7. commit 9dbe67fc8c722bc8df4a6a792677a93a073773f4 Author: León Orell Valerian Liehr <[email protected]> Date: Tue Jul 4 19:45:58 2023 +0200 Revert "use c literals in library" This reverts commit f212ba6d6d60963c8101bb24fc3e53fca80c046f. commit 5b25f9d8bdb4a5ffdaed4fb6ebdc521c6eba1b0f Author: León Orell Valerian Liehr <[email protected]> Date: Tue Jul 4 19:45:55 2023 +0200 Revert "fix ptr cast" This reverts commit 2f459f7f140307b5abbb7ea81440ed1843b490e7. commit c6643b50ea7290daf0a9f0e33d1f27c6f52796ce Author: León Orell Valerian Liehr <[email protected]> Date: Tue Jul 4 19:40:48 2023 +0200 Revert the lexing of c_str_literals commit dfe0683138de0959b6ab6a039b54d9347f6a6355 Merge: 99f7d368c0e 9e5f61fcdd2 Author: bors <[email protected]> Date: Wed Jul 5 11:04:17 2023 +0000 Auto merge of #112594 - ChrisDenton:process=-kill, r=Amanieu Return `Ok` on kill if process has already exited This will require an FCP from `@rust-lang/libs-api.` Fixes #112423. See that issue for more details. commit 9f3fba8da81300dc1a734a9cb1e2d804286b4f8d Author: Vadim Petrochenkov <[email protected]> Date: Wed Jul 5 13:46:42 2023 +0300 resolve: Add comments explaining use of `Interned` commit c1f412f9a93cee5bfd4c4cbdf0e0cb78fc51da2c Author: Vadim Petrochenkov <[email protected]> Date: Tue Jul 4 20:00:42 2023 +0300 resolve: Use `Interned` for `Module` commit 4abdaeb67eb3aa85941cee4928b75dbcbd120148 Author: Vadim Petrochenkov <[email protected]> Date: Tue Jul 4 18:51:35 2023 +0300 resolve: Use `Interned` for `Import` commit 8efd9cc30dd04cb4e58d9c0420f9ae88e5850f4e Author: Vadim Petrochenkov <[email protected]> Date: Tue Jul 4 17:28:57 2023 +0300 resolve: Use `Interned` for `NameBinding` commit cb570d6bc1251f32a07d8ce173dc735be78a325f Author: Zalathar <[email protected]> Date: Wed Jul 5 18:04:58 2023 +1000 Move `coverageinfo::ffi` and `coverageinfo::map` out of SSA commit 9c430d38cf10ec3fab459be00e87057e5cce55b0 Author: Zalathar <[email protected]> Date: Wed Jul 5 17:56:10 2023 +1000 Remove trait `CoverageInfoMethods`, since non-LLVM backends don't need it These methods are only ever called from within `rustc_codegen_llvm`, so they can just be declared there as well. commit 4169d0f756dde8b3e692610bddb3c948c5cd53ea Author: Zalathar <[email protected]> Date: Wed Jul 5 17:39:40 2023 +1000 Narrow trait `CoverageInfoBuilderMethods` down to just one method This effectively inlines most of `FunctionCx::codegen_coverage` into the LLVM implementation of `CoverageInfoBuilderMethods`. commit 9e5f61fcdd29936938d401c0f0055b9af32caf5c Author: Chris Denton <[email protected]> Date: Wed Jul 5 09:54:16 2023 +0100 Workaround for old android not having echo commit 99f7d368c0ed753db797ee82e89b5a2b7e49509a Merge: 6dab6dc5fcd f80aec7429e Author: bors <[email protected]> Date: Wed Jul 5 08:48:04 2023 +0000 Auto merge of #112319 - oli-obk:assoc_ty_sized_bound_for_object_safety2, …
flip1995
pushed a commit
to flip1995/rust-clippy
that referenced
this pull request
Jul 14, 2023
Comments out the C string literals due to rust-lang/rust#113334 Fixes rust-lang#11121
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 25, 2023
…chenkov Reimplement C-str literals This reverts rust-lang#113334, cc `@fmease.` While converting lexer tokens to ast Tokens in `rustc_parse`, we check the edition of the span of the token. If the edition < 2021, we split the token into two, one being the identifier and other being the str literal.
ofeeg
pushed a commit
to ofeeg/rust-clippy
that referenced
this pull request
Aug 14, 2023
Fixed errors and lack of documentation in mod.rs. Added type check and test case for string slice. Added supposed check for windows paths. Build failure fix. Build fix attempt rust-lang#2. Fixed formatting. Refactor unwind from Option to a new enum Fix tools Make elaborator generic Merge commit '83e42a2337dadac915c956d125f1d69132f36425' into clippyup Tweak output for 'add line' suggestion Special-case item attributes in the suggestion output resolve: Pre-compute non-reexport module children Instead of repeating the same logic by walking HIR during metadata encoding. The only difference is that we are no longer encoding `macro_rules` items, but we never currently need them as a part of this list. They can be encoded separately if this need ever arises. `module_reexports` is also un-querified, because I don't see any reasons to make it a query, only overhead. Alloc `hir::Lit` in an arena to remove the destructor from `Expr` This allows allocating `Expr`s into a dropless arena, which is useful for using length prefixed thing slices in HIR, since these can only be allocated in the dropless arena and not in a typed arena. This is something I'm working on. clippy: add test for rust-lang#10645 Remove very useless `as_substs` usage from clippy Force -Zflatten-format-args=no in Clippy. Remove WithOptconstParam. offset_of Evaluate place expression in `PlaceMention`. Allow `LocalDefId` as the argument to `def_path_str` Merge commit 'a3ed905928a03b6e433d0b429190bf3a847128b3' into clippyup Clippy book: hotfix for broken link change usages of explicit_item_bounds to bound_explicit_item_bounds add EarlyBinder to output of explicit_item_bounds; replace bound_explicit_item_bounds usages; remove bound_explicit_item_bounds query add subst_identity_iter and subst_identity_iter_copied methods on EarlyBinder; use this to simplify some EarlyBinder noise around explicit_item_bounds calls rename `needs_infer` to `has_infer` Make clippy happy uplift `clippy::clone_double_ref` as `suspicious_double_ref_op` clean up Colon from clippy Restrict `From<S>` for `{D,Subd}iagnosticMessage`. Currently a `{D,Subd}iagnosticMessage` can be created from any type that impls `Into<String>`. That includes `&str`, `String`, and `Cow<'static, str>`, which are reasonable. It also includes `&String`, which is pretty weird, and results in many places making unnecessary allocations for patterns like this: ``` self.fatal(&format!(...)) ``` This creates a string with `format!`, takes a reference, passes the reference to `fatal`, which does an `into()`, which clones the reference, doing a second allocation. Two allocations for a single string, bleh. This commit changes the `From` impls so that you can only create a `{D,Subd}iagnosticMessage` from `&str`, `String`, or `Cow<'static, str>`. This requires changing all the places that currently create one from a `&String`. Most of these are of the `&format!(...)` form described above; each one removes an unnecessary static `&`, plus an allocation when executed. There are also a few places where the existing use of `&String` was more reasonable; these now just use `clone()` at the call site. As well as making the code nicer and more efficient, this is a step towards possibly using `Cow<'static, str>` in `{D,Subd}iagnosticMessage::{Str,Eager}`. That would require changing the `From<&'a str>` impls to `From<&'static str>`, which is doable, but I'm not yet sure if it's worthwhile. Use `ty::TraitRef::new` in clippy Fix uses of `TraitRef::identity` in clippy and rustdoc Rename std::mem::size_of_value to std::mem::size_of_val Suggest applicable expression for manual slice size calculation lint Add run-rustfix marker and test file Use `clippy_utils::std_or_core` in manual slice size calculation lint Ignore `manual_slice_size_calculation` in code from macro expansions Add size-parameter to unecessary_box_returns Fixes rust-lang#10641 Suppress the triggering of some lints in derived structures Address comments Update version attribute for 1.69 lints Changelog for Rust 1.69 🌸 [arithmetic_side_effects] Fix rust-lang#10590 Update to a compiletest-rs version that requires `//@` for commands [arithmetic_side_effects] Cache symbols Fix typo in significant_drop_tightening Fix `#[allow(clippy::enum_variant_names)]` directly on variants make [`len_zero`] lint not spanning over parenthesis clippy: drop unused semver crate Ignore `impl Trait`(s) Add lint `items_after_test_module` Compact emmited lint Bump Clippy version -> 0.1.71 Bump nightly version -> 2023-04-23 Fix dogfood test Dont suggest suboptimal_flops unavailable in nostd Fixes rust-lang#10634 use is_inside_const_context query for in_constant split test into 2 Remove check for `lib.register_*` and `src/docs*` in `cargo dev update_lints` This reverts commit 22d435b. Detect if expressions with boolean assignments to the same target Spelling * applying * binding * complex * constituent * demonstrate * desugaring * exact * expression * for * functionalities * github * implementation * infers * multiple conflicting traits * mutable * necessarily * nightly * nonexistent * optional * parameter * reassignments * resources * substitution * suggestion * that * that array is * using the Signed-off-by: Josh Soref <[email protected]> Rewrite search_same description Ignore `shadow` warns in code from macro expansions fix false positive Update allow_attributes_false_positive.rs also check for rest pat in `redundant_pattern_matching` Improve the help message + add a help span don't check if from macro invocation run cargo dev fmt make cargo test pass use in_external_macro Catching, stray, commas, (I'll, never, learn, to, use, them, correctly) 😅 Add the warning to all documentation. add `semicolon_outside_block_if_singleline` lint make cargo test pass refactor make cargo test pass, again improve description a bit refactor config instead of new lint and don't panic make cargo test pass change names to not be implicitly negative use `//@` for commands in tests Update lint_configuration.md run linkcheck in Remark CI fix new lints link install nightly rust-docs run linkcheck without nightly toolchain remove nightly toolchain, add rust-docs component Test Remark Update basics.md Update basics.md Update basics.md update workflow add rust docs toolchain Update remark.yml workflow test manual test update book path add linkcheck book to CI Update lint_passes.md Fix rust-lang#10713 and move the tests to a subdir Remove useless span magic Change module import system Rename items + Delete `imported_module.stderr` new lint: `while_pop_unwrap` elide lifetimes, get rid of glob import move lint to loops, emit proper suggestion, more tests remove unnecessary reference make PopStmt copy+clone rename lint to `manual_while_let_some` fix run-rustfix directive Clarify docs for RESULT_LARGE_ERR globally ignore `#[no_std]` crates Don't ignore `check_radians` Update macros.rs adds lint to detect construction of unit struct using `default` Using `default` to construct a unit struct increases code complexity and adds a function call. This can be avoided by simply removing the call to `default` and simply construct by name. fix diagnostic message style Co-authored-by: Ruby Lazuli <[email protected]> fixed span and corrected test output rename to plural form add more test cases fix failing tests add `rustfix` annotation fix lint docs Inherit stdout/stderr for `cargo dev dogfood` Bump nightly version -> 2023-05-05 Ignore expressions from macros in default_constructed_unit_structs new lint: clippy::ref_patterns Add missing word "are" Ignore `borrow_deref_ref` warnings in code from procedural macros. `Wildcard_imports` ignore `test.rs` files Really mini minor irrelevant change for formatting Now the lint ignores any crates with `--cfg test` Fix header Bump README copyright wip WIP WIP WIP Working Update trait_bounds.rs Update trait_bounds.rs Comments Comments Minimizing changes Fix config formatting, less indenting, more spacing needless_bool: do not simplify code if it loses comments add lint `manual_next_back` checks for manual reverse iteration (`.rev().next()`) of a `DoubleEndedIterator` Update actions/checkout Update actions/setup-node fix: warn on empty line outer AttrKind::DocComment changelog: [`empty_line_after_doc_comments`]: add lint for checking empty lines after rustdoc comments. Fixes: rust-lang#10395 Consider referenced allowed or hard-coded types fix rust-lang#10773 move `is_ty_alias` to `clippy_utils` flip1995: Stepping down from the reviewer rotation A step I was trying to avoid for way too long, but sadly necessary now. I hope I can come back stronger in a few months. Rebase and merge attempt number 2. Included sources to std::path in lint string. Rebase and merge attempt number 2. Fixed arguments in lint string. Renamed lint to join_absolute_path as per request. Ran cargo dev update_lints Ran cargo dev bless after a full cargo test Entered supposed changes, ran cargo dev fmt, test, and bless. initial step towards implementing C string literals rm diag item, use lang item Merge commit '371120bdbf58a331db5dcfb2d9cddc040f486de8' into clippyup Make the BUG_REPORT_URL configurable by tools This greatly simplifies how hard it is to set a custom bug report url; previously tools had to copy the entire hook implementation. - Switch clippy to the new hook This also adds a `extra_info` callback so clippy can include its own version number, which differs from rustc's. - Call `install_ice_hook` in rustfmt make (try_)subst_and_normalize_erasing_regions take EarlyBinder changes from review: add FIXME to clippy and change subst_identity to skip_binder in mir subst methods IAT: Introduce AliasKind::Inherent Drop uplifted clippy::drop_ref Drop uplifted clippy::drop_copy Drop uplifted clippy::forget_ref Drop uplifted clippy::forget_copy Exposes false negative in clippy's diverging_sub_expression Remove `LangItems::require` It's just a short wrapper used by `tcx.require_lang_item`. Deleting it gives us a negative diff. Exclude inherent projections from some alias ty matches Merge commit '435a8ad86c7a33bd7ffb91c59039943408d3b6aa' into clippyup Rename `drop_copy` lint to `dropping_copy_types` Rename `forget_copy` lint to `forgetting_copy_types` Rename `drop_ref` lint to `dropping_references` Rename `forget_ref` lint to `forgetting_references` Replace EarlyBinder(x) with EarlyBinder::new(x) Make EarlyBinder's inner value private; and fix all of the resulting errors Use `Cow` in `{D,Subd}iagnosticMessage`. Each of `{D,Subd}iagnosticMessage::{Str,Eager}` has a comment: ``` // FIXME(davidtwco): can a `Cow<'static, str>` be used here? ``` This commit answers that question in the affirmative. It's not the most compelling change ever, but it might be worth merging. This requires changing the `impl<'a> From<&'a str>` impls to `impl From<&'static str>`, which involves a bunch of knock-on changes that require/result in call sites being a little more precise about exactly what kind of string they use to create errors, and not just `&str`. This will result in fewer unnecessary allocations, though this will not have any notable perf effects given that these are error paths. Note that I was lazy within Clippy, using `to_string` in a few places to preserve the existing string imprecision. I could have used `impl Into<{D,Subd}iagnosticMessage>` in various places as is done in the compiler, but that would have required changes to *many* call sites (mostly changing `&format("...")` to `format!("...")`) which didn't seem worthwhile. Drop uplifted clippy::invalid_utf8_in_unchecked EarlyBinder::new -> EarlyBinder::bind Drop uplifted clippy::cast_ref_to_mut Use translatable diagnostics in `rustc_const_eval` Implement custom diagnostic for ConstParamTy Merge commit '30448e8cf98d4754350db0c959644564f317bc0f' into clippyup Rename `impl_defaultness` to `defaultness` Removed stable/unstable sort arg from into_sorted_stable_ord, fixed a few misc issues, added collect to UnordItems Whoops, submodule change was actually valid - undoing fixup Drop uplifted clippy::undropped_manually_drops Drop uplifted `clippy:cmp_nan` Extend `unused_must_use` to cover block exprs Add `AliasKind::Weak` for type aliases. Only use it when the type alias contains an opaque type. Also does wf-checking on such type aliases. Move WF goal to clause Move ConstEvaluatable to Clause Treat TAIT equation as always ambiguous in coherence Better error for non const `PartialEq` call generated by `match` Make `{Arc,Rc,Weak}::ptr_eq` ignore pointer metadata s/Clause/ClauseKind Support `ast::ExprKind::Become` in clippy Migrate item_bounds to ty::Clause Do not offer any of the suggestions in emit_coerce_suggestions for expr from destructuring assignment desugaring Support `hir::ExprKind::Become` in clippy Migrate predicates_of and caller_bounds to Clause Provide more context for `rustc +nightly -Zunstable-options` on stable Make simd_shuffle_indices use valtrees Merge commit '37f4c1725d3fd7e9c3ffd8783246bc5589debc53' into clippyup Fix valtree changes Fix compile-test tests to work with the new ui_test crate Deal with fallout Patch clippy Move `TyCtxt::mk_x` to `Ty::new_x` where applicable Fix failing clippy tests Comments out the C string literals due to rust-lang/rust#113334 Fixes rust-lang#11121 Rename `adjustment::PointerCast` and variants using it to `PointerCoercion` It makes it sound like the `ExprKind` and `Rvalue` are supposed to represent all pointer related casts, when in reality their just used to share a some enum variants. Make it clear there these are only coercion to make it clear why only some pointer related "casts" are in the enum. Delete `to_string_in_format_args_incremental.rs` It fails CI and passes locally. It passes random directores in `-Cincremental` so maybe something's up. It shouldn't block us here. Drop uplifted `clippy::fn_null_check` Ignore flaky clippy tests. Suggest the correct variable name for `manual_let_else` Split if conditions by its semantics Remove old feature flag in code comment Since let_else feature has been stable in 1.65.0, it's now unnecessary Avoid renaming for TupleStruct with multiple arguments update spec fix: move specs in fire Fix: Some suggestions generated by the option_if_let_else lint did not compile bump up `regex-syntax` dependency version to 0.7.0 Ignoring `let_underscore_untyped` warnings in code from proc macros fixing fmt Checking for proc_macro not only when local.init is Some Remove unnecessary from example fix example heading in `string_slice` don't remove `dbg!` in arbitrary expressions handle nested macros and add tests for them Rename integer_arithmetic redundant_pattern_matching redundant_pattern_matching fix conflict with matches macro fix conflict with matches macro fix error test update a func fix reviewer comments fix reviewer comments: tests results update tests update test option Don't suggest unnameable types in box_default, let_underscore_untyped Search for inactive `cfg` attributes and empty macro expansion through the entire block Slightly refactor constant evaluation and add detection for empty macro expansion and `cfg`ed statements. Improve `SpanlessEq` * Don't consider expansions of different macros to be the same, even if they expand to the same tokens * Don't consider `cfg!` expansions to be equal if they check different configs. enhance `needless_collect` Updates `needless_collect` to lint for collecting into a method or function argument thats taking an `IntoIterator` (for example `extend`). Every `Iterator` trivially implements `IntoIterator` and colleting it only causes an unnecessary allocation. Add new `UNIQUE_CFG_CONDITION` lint Add UI test for UNIQUE_CFG_CONDITION Update CHANGELOG Add check for empty cfg `all` condition Update urls in Type Checking Bump nightly version -> 2023-05-20 [`match_wild_err_arm`]: do not lint in const contexts consider array initializer for `large_stack_arrays` add test case for rust-lang#10741 Unit tests highlighting unsafe match issue These unit tests generate non-compilable code. I did NOT `bless` them on purpose because the stderr output is not good. I'm surprised we don't auto-compile the suggestions here - is this something that can be easily enabled? See rust-lang#10808 Fix unsafe blocks Use #[rustfmt::skip] remove todo Run-rustfix needless_else: new lint to check for empty else clauses the implementation!! check msrv Update clippy_lints/src/casts/ptr_cast_constness.rs Co-authored-by: llogiq <[email protected]> add description and rename msrv tests change `clippy::version` to 1.71.0 Display the `needless_return` suggestion error out if lint name contains dash replace `-` instead of erroring out apply suggestion Co-authored-by: Philipp Krones <[email protected]> Address Dependabot alerts do not consider `await` in nested `async` blocks remove old span_lint point to `await` expr in note redundant pattern matches! result [`default_constructed_unit_structs`]: do not lint type aliases Ignore #[cfg]'d out code in needless_else Fix formatting of if let chain Some improvements to the manual_let_else lint suggestions * Replace variables inside | patterns in the if let: let v = if let V::A(v) | V::B(v) = v { v } else ... * Support nested patterns: let v = if let Ok(Ok(Ok(v))) = v { v } else ... * Support tuple structs with more than one arg: let v = V::W(v, _) = v { v } else ... * Correctly handle .. in tuple struct patterns: let v = V::X(v, ..) = v { v } else ... Fixing `invalid_regex` with invalid UTF8. Also, adding more test cases Update version attribute for 1.70 lints Changelog for Rust 1.70 🔨 Change changelog typos Co-authored-by: Takayuki Nakata <[email protected]> deps: drop serde feature from url actually, remove rustc-workspace-hack dependency too [`wildcard_imports`] Modules that contain `prelude` are also allowed This commit fixes rust-lang#10846 by checking if the path segment contains the word "prelude". Signed-off-by: Charalampos Mitrodimas <[email protected]> fix issues 10836 change booleans file and update tests Remove lint name and category fields from the new lint issue form new lint: `missing_field_in_debug` move some strings into consts, more tests s/missing_field_in_debug/missing_fields_in_debug dont trigger in macro expansions make dogfood tests happy minor cleanups replace HashSet with FxHashSet replace match_def_path with match_type if_chain -> let chains, fix markdown, allow newtype pattern fmt consider string literal in `.field()` calls as used don't intern defined symbol, remove mentions of 'debug_tuple' special-case PD, account for field access through `Deref` don't lint enums, update note in lint description Explain which paths clippy searches for configuration in docs Explain path-search using a list Add spans to `clippy.toml` error messages Bump nightly version -> 2023-06-02 Bump Clippy version -> 0.1.72 add checking for cfg(features = ...) Update *Current stable* text in `CHANGELOG.md` Refresh Lint Configuration's looks emit `unnecessary_cast` on raw pointers as well ok actually appease CI I should always run cargo test before committing 😅 add generics in test also ensure generics with the same type are linted Use URL parameters for filter states This retains the settings during browser navigation and allows sharing links with additional configuration. Handle back/forward when using URL parameters for filter states Clippy Lints page - Delay updating of the URL in response to search input Update on blur, enter keypress, and a debounced delay of 1000 ms. This keeps the URL updated, but not distractingly so. Clippy Lints page - Do not show groups in URL parameters if reset to defaults Clippy Lints page - Fix path watch triggering Clippy Lints page - Do not show filters in URL if configured as default values only lint when `cast_from` and `cast_to`'s ty are the same weird manual_let_else: only add () around PatKind::Or at the top level At the top level, () are required, but on the levels below they are not. Support multi-binding situations as well as tuple patterns Support struct patterns new lint: `explicit_into_iter_fn_arg` dogfood update docs, simplify arg->param map, dont lint on chain merge `explicit_into_iter_fn_arg` into `useless_conversion` fix new failing proc macro tests add plural form to useless_conversion if depth > 0 Add lint to check lint formulation messages Fix lints that don't conform to the standard formulation refactor(test): Move attribute to lint level Fix suggestion on fully qualified syntax ignore `Foo::deref` altogether Add from_over_into replace for type in `Self` reference Ignore from_over_into if it contains Self Move bail into lint to prevent no-linting, move to unfixable don't lint `allow_attributes` on attributes from proc macros foiled again (forgot to run cargo test) Fix `attr_search_pat` for `#[cfg_attr]` remove tuple add test for `?` desugaring Update allow_attributes_without_reason.rs `to_xx_bytes` implemented, `from_xx_bytes` todo Mentioned in rust-lang#10765 implement `host_endian_bytes` and the other two weird grammar refine output unidiomatic `if_chain!` don't allocate the names use enum for `prefix` instead of `&str` Update endian_bytes.rs derive Copy/PartialEq for `Prefix` Remove `CARGO_UNSTABLE_SPARSE_REGISTRY` env from ci It is now the default to use the sparse registry Move redundant_clone to nursery Add a test that checks for old style test headers [`unnecessary_lazy_eval`]: don't lint on types with deref impl Bring up Rust lang #37612 as a known problem for let_and_return Compact issue link Co-authored-by: Takayuki Nakata <[email protected]> Add redundant type annotations lint Move `redundant_type_annotations` to restriction Extract common logic to function Add support to returned refs from `MethodCall` Add `Limitations` section make cast_possible_wrap not lint on conversions for sizes that cannot wrap, and make it work correctly for 16 bit {u,i}size add more info link Fix rust-lang#10498 Use type snippet instead of init expr for proc macro check check for `_` instead account for autoderef in eager_or_lazy don't call `type_of` on generic params Don't warn if there is a comment between else and curly bracket make `useless_vec` smarter allow the lint in a bunch of tests don't allow `as_slice` for now Adds new lint `arc_with_non_send_or_sync` Updating documentation and lint formatting. Adding extra check to ignore generic args. Swapping to matches macro. handle RangeInclusive function desugar actually don't lint for inclusive range Fix `useless_vec` suggestion in `for _ in vec![..]` Ignore more pointer types in `unnecessary_cast` check that the adjusted receiver type matches target add the `excessive_*` style lints change it to nursery category add `excessive_nesting` Close code block in example couple more notes decided against reinventing the wheel check non-inline modules, ignore all macros work with lint attributes move to `complexity` but don't lint by default Check if from proc macro and better tests remove revisions fix rust-lang#10776 actually fix it also lint single expression blocks Update mixed_read_write_in_expression.rs Update diverging_sub_expression.stderr ensure there are no stmts for expr check refactor Update excessive_nesting.rs Update excessive_nesting.rs allow disabling module inception on private modules allow disabling module inception on private modules Direct towards late passes in `cargo dev new_lint` handle exponent without digits add test ignore more type aliases in unnecessary_cast ignore more type aliases in unnecessary_cast Update unnecessary_cast.stderr Add `needless_if` lint make cargo test pass add description add description don't lint on `if let` don't lint on `if let` Update needless_if.fixed Stop visiting once it's found `Let` Extend `explicit_iter_loop` to all types Split `for_loops` tests Fix `explicit_into_iter_loop` with mutable references Reborrow mutable references in `explicit_iter_loop` Fix rust-lang#10504, don't lint on derived code refactor Update trait_bounds.rs `ty_search_pat` `impl WithSearchPat for Ty` Update check_proc_macro.rs Add lint `single_letter_idents` rename the lint make cargo test pass + example ignore generics and allow arbitrary threshold make it work for locals as well oopos add to tests and configuration `cargo collect-metadata` refactor and add link to issue new lint: `large_stack_frames` `cargo dev update_lints` fmt use span_lint_and_note rename "drawbacks" to "known issues" make lint description easier to read, prevent ICE fix rebase weirdness update lint_configuration.md Don't ling `as_conversions` in proc macros [`useless_vec`]: detect unnecessary `vec![_]` add- and fix existing tests Add test code Boilerplate for the new lint Add hook Add the lint to the lib Implement the lint Implement the lint for expect Implement the suggestion Recognize `Ok` Recognize `unwrap_or` methods Recognize `unwrap_or_else` method Track init and unwrap of expr Recognize `Err` Support suggesting panics Add more tests Preserve type annotations when present Fix all the other tests Don't lint non-statement/faux empty `needless_if`s Now `cargo collect-metadata` updates the `CHANGELOG.md` Remove dead code in `needless_pass_by_value` Fix `missing_const_for_fn` not checking `~const Destruct` use trait solver instead; created spaghetti code cleanup spaghetti code remove unnecessary checks remove `in_move` [`needless_lifetimes`]' suggestion now points at the lifetimes [`no_effect`]: suggest adding `return` if applicable make cargo test pass Revert "Make it `Unspecified`" This reverts commit 7748630. Make it `Unspecified` [`map_unwrap_or`]: don't lint when referenced variable is moved Ignore `main()` in `no_test` code fences run `cargo dev fmt` add main function to test itself [`derivable_impls`]: don't lint if expr unsize-coerces fmt dogfood fix internal lints Add lint [`single_range_in_vec_init`] refactor a bit [`unnecessary_fold`]: suggest turbofish if necessary get rid of unnecessary function pointer move check_fold_with_op function out from_over_into: Show suggestions for non-Self expanded paths [`match_same_arms`]: don't lint if `non_exhaustive_omitted_patterns` formatting :/ new lint: `drain_collect` take into account reborrowing when inserting `&mut` in sugg make clippy happy add a description add test case for not whole length, move sugg into variable add lint [`needless_clone_impl`] Update needless_impls.rs rename lint and disallow `clone_from` missing_panics_doc: pickup expect method bless address or allow clippy::missing_panics_doc in clippy-dev merge test improve grammer in comment sentence Co-authored-by: dswij <[email protected]> Refactor to make following commit pass single_match_else lint Make `--explain` subcommand return 1 for missing lints Ignore more type aliases in `unnecessary_cast` Adapt versions.html file to cleaned up gh-pages Fix version.py after deleting v* dirs I missed updating this file. I also ran black and isort over it. Adding configuration to allow safety comment above stmt containing unsafe block Addressing reviewer comments adding all ui tests to the configuration test as well Collecting metadata Exlude `todo!()` from `missing_panics_in_doc` `missing_panics_in_doc` bless test and add additional macro testcase new lint `single_call_fn` add test for closures Ignore functions annotated with `#[test]` Fix `find_format_arg_expr` when incremental compilation is enabled Fix rust-lang#10792 Dogfood Fix false positive of [self_named_module_files] and [mod_module_files] Move continue into if statement Co-authored-by: Catherine <[email protected]> [`redundant_closure_call`]: handle nested closures fix docs don't unnecessarily walk more in visitor and add more tests Ignore in-proc-macros items use PlaceRef abstractions add non-test-case for suggesting const on functions accessing union fields allow safety comment above attributes [`single_match`]: don't lint if block contains comments add test for block comment and add note to description Don't lint `excessive_precision` on inf Add WebAssembly to allowed idents add WebAssembly to test [`borrow_as_ptr`]: Ignore temporaries use rustc's criteria for a temporary Don't lint `iter_nth_zero` in `next` include a ref if argument is not just a numeric literal use let chains, move assignments out of block, add tests declare needs_ref later [`type_repetition_in_bounds`]: respect msrv for combining maybe bounds put issue link between <> rename MSRV alias, add MSRV to lint doc update lint configuration Don't lint `ptr_arg` when return type uses Cow's lifetime [`format_push_string`]: look through match, if, if-let Avoid linting on procedural macros Lint `mem_forget` if fields are `Drop` move to `drop_forget_ref` make note less verbose Check if `if` conditions always evaluate to true in `never_loop` update changelog's data ranges Port clippy away from compiletest to ui_test Update tests Find the right `cargo-clippy` binary in CI Don't lint code from external macros add `needless_raw_string_hashes` lint add semicolon in doctest new lint `needless_raw_string` + refactor a bit Thanks, #112373, for the snippet at line 75! Update raw_strings.rs don't lint `needless_raw_string_hashes` when it's unnecessary change category and refactor Update raw_strings.rs Revert "new lints for visibility" This reverts commit 0e5a537. new lints for visibility Fix compile-test under cargo nextest Add BLESS for compile-test and some cleanup new lint: `manual_range_pattern` manual_range_pattern -> manual_range_patterns Use substring matching for TESTNAME new lints for visibility Change category and update to `ui_test` [`unused_async`]: don't lint on async trait impls move `is_in_trait_method` to utils and rename [`option_if_let_else`]: suggest `.as_ref()` if `&Option<_>` allow dead code in the test [`question_mark`]: don't lint inside of `try` block lint in nested bodies if `try` is in outer body suggests `is_some_and` over `map().unwrap_or(false)` changed the msrv to 1.70 to suggest `is_some_and` if the msrv is not >= 1.70 then the `map_or` is suggested instead of `is_some_and` (even when `unwrap_or` returns false) now passes dogfood by wrapping unwrap_recv and unwrap_arg into a tuple was previously failing due to `check` having to many arguments. Revert "now passes dogfood by wrapping unwrap_recv and unwrap_arg into a tuple" This reverts commit 7b91844. ignore too_many_arguments on `check` changed msrv name for consistency & changed nested if for style updated list of lints that use msrv ran `cargo collect-metadata` New lint [`redundant_rest_pattern`] Rename the lint Add note to remove `if` statement altogether Fix rust-lang#10413 Dogfood Bump nightly version -> 2023-06-29 Make `eq_op` suggest `.is_nan()` New lint `tuple_array_conversions` Add msrv check and make test pass Fix FP heavily refactor New lint `manual_try_fold` Add msrv tests Typo update docs address comments Fix typos Use `cargo build --tests` in CI let_and_return: lint 'static lifetimes, don't lint borrows in closures Add `SPEEDTEST` Fix dogfood Finally fix dogfood [`missing_fields_in_debug`]: make sure `self` is an adt new lint: `type_id_on_box` that was definitely not the right version add it to the methods lint pass add a few more test cases s/is_dyn_trait/is_dyn_any [`arc_with_non_send_sync`]: look for nested type parameters [`useless_vec`]: use the source span Don't lint manual_let_else in cases where the question mark operator would work Also, lint question_mark for `let...else` clauses that can be simplified to use `?`. This lint isn't perfect as it doesn't support the unstable try blocks. Fix the now stricter lint in manual_rem_euclid.rs Put into one pass Don't suppress manual_let_else if question_mark is allowed If question_mark is allowed, there is no overlap any more, so we can just not suppress it. Move pat_and_expr_can_be_question_mark into clippy_utils Fix FP [`needless_raw_string_hashes`] [`useless_vec`]: add more tests for macro combinations new lint: `read_line_without_trim` add test cases for u32, f32, bool, String Fix regex lints for regex 1.9.0 arc_with_non_send_sync: reword and move to suspicious Pass correct substs to `implements_trait` in `incorrect_impls` `Copy<T>` does in fact not exist. The substs on the trait_ref contain the `Self` type of the impl as the first parameter, so passing that to `implements_trait`, which then nicely prepends the `Self` type for us does not end will. Fix changelog PR listings, create them automatically in `fetch_prs_between.sh` implement `manual_partial_ord_impl` first try at this rename to `manual_partial_ord_and_ord_impl` cargo dev fmt cargo test passes cargo test passes refactor a lil Update bool_comparison.stderr heavily refactor + bump `clippy::version` refactor refactor check bounds to increase accuracy, and add todos use `other` instead of `self` refactor `manual_float_methods` Make suggestion give multiple alternatives Refactor, remove `Constant::to_bits` [significant_drop_tightening] Fix rust-lang#11128 Dogfood Add test for rust-lang#10535 Fix rust-lang#10535 Add needless_pass_by_ref lint Add UI test for `needless_pass_by_ref_mut` Update UI tests with new `needless_pass_by_ref_mut` lint Fix warnings of `needless_pass_by_ref_mut` in clippy Add warning for `NEEDLESS_PASS_BY_REF_MUT` lint about the fact that it changes API Add warning about semver compatibility if it's a public function "try this" -> "try" [`unnecessary_literal_unwrap`]: don't lint if binding initializer is expn [`manual_range_patterns`]: lint negative values [`manual_range_patterns`]: document what range we don't lint changelog: Fix typo in `needless_pass_by_ref_mut` lint description adjust applicability and suggest making binding mutable Use depinfo to discover UI test dependencies [`unnecessary_literal_unwrap`]: lint `unwrap_unchecked` [`unnecessary_literal_unwrap`]: also handle unwrap_err_unchecked Update version attribute for 1.71 lints Changelog for Rust 1.71 👑 Changelog: Add disclaimer about the new format [`panic_in_result_fn`] remove `todo!`, `unimplemented!`, `unreachable!` This commit fixes rust-lang#11025 by removing checks for `todo!`, `unimplemented!` and `unreachable!`. Signed-off-by: Panagiotis Foliadis <[email protected]> Add "Known problems" section to `needless_borrow` documentation [`tuple_array_conversions`]: move from `complexity` to `nursery` Due to outstanding issues: * rust-lang#11082 * rust-lang#11085 * rust-lang#11100 (rust-lang#11105) * rust-lang#11124 * rust-lang#11144 [`arithmetic_side_effect`]: allow different rhs type Add `imports_granularity = "Module"` to rustfmt.toml Trigger a rebuild when CLIPPY_CONF_DIR changes Set `unnecessary_cast` suggestion to `MaybeIncorrect` for pointer casts Removing casts may cause type inference to stop working which requires manual intervention Bump Clippy version -> 0.1.73 Bump nightly version -> 2023-07-14 renamed lint Removed if chain. Added the rest of the suggested changes. Applied cargo test supposed changes. Resolved rest of changes. Resolved nitpicks. Update clippy_lints/src/methods/join_absolute_paths.rs Co-authored-by: Catherine Flores <[email protected]> Formatted and blessed. Got rid of println! calls. Rebase attempt number 2
ofeeg
added a commit
to ofeeg/rust-clippy
that referenced
this pull request
Aug 15, 2023
Refactor unwind from Option to a new enum Fix tools Make elaborator generic Merge commit '83e42a2337dadac915c956d125f1d69132f36425' into clippyup Tweak output for 'add line' suggestion Special-case item attributes in the suggestion output resolve: Pre-compute non-reexport module children Instead of repeating the same logic by walking HIR during metadata encoding. The only difference is that we are no longer encoding `macro_rules` items, but we never currently need them as a part of this list. They can be encoded separately if this need ever arises. `module_reexports` is also un-querified, because I don't see any reasons to make it a query, only overhead. Alloc `hir::Lit` in an arena to remove the destructor from `Expr` This allows allocating `Expr`s into a dropless arena, which is useful for using length prefixed thing slices in HIR, since these can only be allocated in the dropless arena and not in a typed arena. This is something I'm working on. clippy: add test for rust-lang#10645 Remove very useless `as_substs` usage from clippy Force -Zflatten-format-args=no in Clippy. Remove WithOptconstParam. offset_of Evaluate place expression in `PlaceMention`. Allow `LocalDefId` as the argument to `def_path_str` Merge commit 'a3ed905928a03b6e433d0b429190bf3a847128b3' into clippyup Clippy book: hotfix for broken link change usages of explicit_item_bounds to bound_explicit_item_bounds add EarlyBinder to output of explicit_item_bounds; replace bound_explicit_item_bounds usages; remove bound_explicit_item_bounds query add subst_identity_iter and subst_identity_iter_copied methods on EarlyBinder; use this to simplify some EarlyBinder noise around explicit_item_bounds calls rename `needs_infer` to `has_infer` Make clippy happy uplift `clippy::clone_double_ref` as `suspicious_double_ref_op` clean up Colon from clippy Restrict `From<S>` for `{D,Subd}iagnosticMessage`. Currently a `{D,Subd}iagnosticMessage` can be created from any type that impls `Into<String>`. That includes `&str`, `String`, and `Cow<'static, str>`, which are reasonable. It also includes `&String`, which is pretty weird, and results in many places making unnecessary allocations for patterns like this: ``` self.fatal(&format!(...)) ``` This creates a string with `format!`, takes a reference, passes the reference to `fatal`, which does an `into()`, which clones the reference, doing a second allocation. Two allocations for a single string, bleh. This commit changes the `From` impls so that you can only create a `{D,Subd}iagnosticMessage` from `&str`, `String`, or `Cow<'static, str>`. This requires changing all the places that currently create one from a `&String`. Most of these are of the `&format!(...)` form described above; each one removes an unnecessary static `&`, plus an allocation when executed. There are also a few places where the existing use of `&String` was more reasonable; these now just use `clone()` at the call site. As well as making the code nicer and more efficient, this is a step towards possibly using `Cow<'static, str>` in `{D,Subd}iagnosticMessage::{Str,Eager}`. That would require changing the `From<&'a str>` impls to `From<&'static str>`, which is doable, but I'm not yet sure if it's worthwhile. Use `ty::TraitRef::new` in clippy Fix uses of `TraitRef::identity` in clippy and rustdoc Rename std::mem::size_of_value to std::mem::size_of_val Suggest applicable expression for manual slice size calculation lint Add run-rustfix marker and test file Use `clippy_utils::std_or_core` in manual slice size calculation lint Ignore `manual_slice_size_calculation` in code from macro expansions Add size-parameter to unecessary_box_returns Fixes rust-lang#10641 Suppress the triggering of some lints in derived structures Address comments Update version attribute for 1.69 lints Changelog for Rust 1.69 🌸 [arithmetic_side_effects] Fix rust-lang#10590 Update to a compiletest-rs version that requires `//@` for commands [arithmetic_side_effects] Cache symbols Fix typo in significant_drop_tightening Fix `#[allow(clippy::enum_variant_names)]` directly on variants make [`len_zero`] lint not spanning over parenthesis clippy: drop unused semver crate Ignore `impl Trait`(s) Add lint `items_after_test_module` Compact emmited lint Bump Clippy version -> 0.1.71 Bump nightly version -> 2023-04-23 Fix dogfood test Dont suggest suboptimal_flops unavailable in nostd Fixes rust-lang#10634 use is_inside_const_context query for in_constant split test into 2 Remove check for `lib.register_*` and `src/docs*` in `cargo dev update_lints` This reverts commit 22d435b. Detect if expressions with boolean assignments to the same target Spelling * applying * binding * complex * constituent * demonstrate * desugaring * exact * expression * for * functionalities * github * implementation * infers * multiple conflicting traits * mutable * necessarily * nightly * nonexistent * optional * parameter * reassignments * resources * substitution * suggestion * that * that array is * using the Signed-off-by: Josh Soref <[email protected]> Rewrite search_same description Ignore `shadow` warns in code from macro expansions fix false positive Update allow_attributes_false_positive.rs also check for rest pat in `redundant_pattern_matching` Improve the help message + add a help span don't check if from macro invocation run cargo dev fmt make cargo test pass use in_external_macro Catching, stray, commas, (I'll, never, learn, to, use, them, correctly) 😅 Add the warning to all documentation. add `semicolon_outside_block_if_singleline` lint make cargo test pass refactor make cargo test pass, again improve description a bit refactor config instead of new lint and don't panic make cargo test pass change names to not be implicitly negative use `//@` for commands in tests Update lint_configuration.md run linkcheck in Remark CI fix new lints link install nightly rust-docs run linkcheck without nightly toolchain remove nightly toolchain, add rust-docs component Test Remark Update basics.md Update basics.md Update basics.md update workflow add rust docs toolchain Update remark.yml workflow test manual test update book path add linkcheck book to CI Update lint_passes.md Fix rust-lang#10713 and move the tests to a subdir Remove useless span magic Change module import system Rename items + Delete `imported_module.stderr` new lint: `while_pop_unwrap` elide lifetimes, get rid of glob import move lint to loops, emit proper suggestion, more tests remove unnecessary reference make PopStmt copy+clone rename lint to `manual_while_let_some` fix run-rustfix directive Clarify docs for RESULT_LARGE_ERR globally ignore `#[no_std]` crates Don't ignore `check_radians` Update macros.rs adds lint to detect construction of unit struct using `default` Using `default` to construct a unit struct increases code complexity and adds a function call. This can be avoided by simply removing the call to `default` and simply construct by name. fix diagnostic message style Co-authored-by: Ruby Lazuli <[email protected]> fixed span and corrected test output rename to plural form add more test cases fix failing tests add `rustfix` annotation fix lint docs Inherit stdout/stderr for `cargo dev dogfood` Bump nightly version -> 2023-05-05 Ignore expressions from macros in default_constructed_unit_structs new lint: clippy::ref_patterns Add missing word "are" Ignore `borrow_deref_ref` warnings in code from procedural macros. `Wildcard_imports` ignore `test.rs` files Really mini minor irrelevant change for formatting Now the lint ignores any crates with `--cfg test` Fix header Bump README copyright wip WIP WIP WIP Working Update trait_bounds.rs Update trait_bounds.rs Comments Comments Minimizing changes Fix config formatting, less indenting, more spacing needless_bool: do not simplify code if it loses comments add lint `manual_next_back` checks for manual reverse iteration (`.rev().next()`) of a `DoubleEndedIterator` Update actions/checkout Update actions/setup-node fix: warn on empty line outer AttrKind::DocComment changelog: [`empty_line_after_doc_comments`]: add lint for checking empty lines after rustdoc comments. Fixes: rust-lang#10395 Consider referenced allowed or hard-coded types fix rust-lang#10773 move `is_ty_alias` to `clippy_utils` flip1995: Stepping down from the reviewer rotation A step I was trying to avoid for way too long, but sadly necessary now. I hope I can come back stronger in a few months. Refactor unwind from Option to a new enum Fix tools Make elaborator generic Merge commit '83e42a2337dadac915c956d125f1d69132f36425' into clippyup Tweak output for 'add line' suggestion Special-case item attributes in the suggestion output resolve: Pre-compute non-reexport module children Instead of repeating the same logic by walking HIR during metadata encoding. The only difference is that we are no longer encoding `macro_rules` items, but we never currently need them as a part of this list. They can be encoded separately if this need ever arises. `module_reexports` is also un-querified, because I don't see any reasons to make it a query, only overhead. Alloc `hir::Lit` in an arena to remove the destructor from `Expr` This allows allocating `Expr`s into a dropless arena, which is useful for using length prefixed thing slices in HIR, since these can only be allocated in the dropless arena and not in a typed arena. This is something I'm working on. clippy: add test for rust-lang#10645 Remove very useless `as_substs` usage from clippy Force -Zflatten-format-args=no in Clippy. Remove WithOptconstParam. offset_of Evaluate place expression in `PlaceMention`. Allow `LocalDefId` as the argument to `def_path_str` Merge commit 'a3ed905928a03b6e433d0b429190bf3a847128b3' into clippyup Clippy book: hotfix for broken link change usages of explicit_item_bounds to bound_explicit_item_bounds add EarlyBinder to output of explicit_item_bounds; replace bound_explicit_item_bounds usages; remove bound_explicit_item_bounds query add subst_identity_iter and subst_identity_iter_copied methods on EarlyBinder; use this to simplify some EarlyBinder noise around explicit_item_bounds calls rename `needs_infer` to `has_infer` Make clippy happy uplift `clippy::clone_double_ref` as `suspicious_double_ref_op` clean up Colon from clippy Restrict `From<S>` for `{D,Subd}iagnosticMessage`. Currently a `{D,Subd}iagnosticMessage` can be created from any type that impls `Into<String>`. That includes `&str`, `String`, and `Cow<'static, str>`, which are reasonable. It also includes `&String`, which is pretty weird, and results in many places making unnecessary allocations for patterns like this: ``` self.fatal(&format!(...)) ``` This creates a string with `format!`, takes a reference, passes the reference to `fatal`, which does an `into()`, which clones the reference, doing a second allocation. Two allocations for a single string, bleh. This commit changes the `From` impls so that you can only create a `{D,Subd}iagnosticMessage` from `&str`, `String`, or `Cow<'static, str>`. This requires changing all the places that currently create one from a `&String`. Most of these are of the `&format!(...)` form described above; each one removes an unnecessary static `&`, plus an allocation when executed. There are also a few places where the existing use of `&String` was more reasonable; these now just use `clone()` at the call site. As well as making the code nicer and more efficient, this is a step towards possibly using `Cow<'static, str>` in `{D,Subd}iagnosticMessage::{Str,Eager}`. That would require changing the `From<&'a str>` impls to `From<&'static str>`, which is doable, but I'm not yet sure if it's worthwhile. Use `ty::TraitRef::new` in clippy Fix uses of `TraitRef::identity` in clippy and rustdoc Rename std::mem::size_of_value to std::mem::size_of_val Suggest applicable expression for manual slice size calculation lint Add run-rustfix marker and test file Use `clippy_utils::std_or_core` in manual slice size calculation lint Ignore `manual_slice_size_calculation` in code from macro expansions Add size-parameter to unecessary_box_returns Fixes rust-lang#10641 Suppress the triggering of some lints in derived structures Address comments Update version attribute for 1.69 lints Changelog for Rust 1.69 🌸 [arithmetic_side_effects] Fix rust-lang#10590 Update to a compiletest-rs version that requires `//@` for commands [arithmetic_side_effects] Cache symbols Fix typo in significant_drop_tightening Fix `#[allow(clippy::enum_variant_names)]` directly on variants make [`len_zero`] lint not spanning over parenthesis clippy: drop unused semver crate Ignore `impl Trait`(s) Add lint `items_after_test_module` Compact emmited lint Bump Clippy version -> 0.1.71 Bump nightly version -> 2023-04-23 Fix dogfood test Dont suggest suboptimal_flops unavailable in nostd Fixes rust-lang#10634 use is_inside_const_context query for in_constant split test into 2 Remove check for `lib.register_*` and `src/docs*` in `cargo dev update_lints` This reverts commit 22d435b. Detect if expressions with boolean assignments to the same target Spelling * applying * binding * complex * constituent * demonstrate * desugaring * exact * expression * for * functionalities * github * implementation * infers * multiple conflicting traits * mutable * necessarily * nightly * nonexistent * optional * parameter * reassignments * resources * substitution * suggestion * that * that array is * using the Signed-off-by: Josh Soref <[email protected]> Rewrite search_same description Ignore `shadow` warns in code from macro expansions fix false positive Update allow_attributes_false_positive.rs also check for rest pat in `redundant_pattern_matching` Improve the help message + add a help span don't check if from macro invocation run cargo dev fmt make cargo test pass use in_external_macro Catching, stray, commas, (I'll, never, learn, to, use, them, correctly) 😅 Add the warning to all documentation. add `semicolon_outside_block_if_singleline` lint make cargo test pass refactor make cargo test pass, again improve description a bit refactor config instead of new lint and don't panic make cargo test pass change names to not be implicitly negative use `//@` for commands in tests Update lint_configuration.md run linkcheck in Remark CI fix new lints link install nightly rust-docs run linkcheck without nightly toolchain remove nightly toolchain, add rust-docs component Test Remark Update basics.md Update basics.md Update basics.md update workflow add rust docs toolchain Update remark.yml workflow test manual test update book path add linkcheck book to CI Update lint_passes.md Fix rust-lang#10713 and move the tests to a subdir Remove useless span magic Change module import system Rename items + Delete `imported_module.stderr` new lint: `while_pop_unwrap` elide lifetimes, get rid of glob import move lint to loops, emit proper suggestion, more tests remove unnecessary reference make PopStmt copy+clone rename lint to `manual_while_let_some` fix run-rustfix directive Clarify docs for RESULT_LARGE_ERR globally ignore `#[no_std]` crates Don't ignore `check_radians` Update macros.rs adds lint to detect construction of unit struct using `default` Using `default` to construct a unit struct increases code complexity and adds a function call. This can be avoided by simply removing the call to `default` and simply construct by name. fix diagnostic message style Co-authored-by: Ruby Lazuli <[email protected]> fixed span and corrected test output rename to plural form add more test cases fix failing tests add `rustfix` annotation fix lint docs Inherit stdout/stderr for `cargo dev dogfood` Bump nightly version -> 2023-05-05 Ignore expressions from macros in default_constructed_unit_structs new lint: clippy::ref_patterns Add missing word "are" Ignore `borrow_deref_ref` warnings in code from procedural macros. `Wildcard_imports` ignore `test.rs` files Really mini minor irrelevant change for formatting Now the lint ignores any crates with `--cfg test` Fix header Bump README copyright wip WIP WIP WIP Working Update trait_bounds.rs Update trait_bounds.rs Comments Comments Minimizing changes Fix config formatting, less indenting, more spacing needless_bool: do not simplify code if it loses comments add lint `manual_next_back` checks for manual reverse iteration (`.rev().next()`) of a `DoubleEndedIterator` Update actions/checkout Update actions/setup-node fix: warn on empty line outer AttrKind::DocComment changelog: [`empty_line_after_doc_comments`]: add lint for checking empty lines after rustdoc comments. Fixes: rust-lang#10395 Consider referenced allowed or hard-coded types fix rust-lang#10773 move `is_ty_alias` to `clippy_utils` flip1995: Stepping down from the reviewer rotation A step I was trying to avoid for way too long, but sadly necessary now. I hope I can come back stronger in a few months. Rebase and merge attempt number 2. Included sources to std::path in lint string. Rebase and merge attempt number 2. Fixed arguments in lint string. Renamed lint to join_absolute_path as per request. Ran cargo dev update_lints Ran cargo dev bless after a full cargo test Entered supposed changes, ran cargo dev fmt, test, and bless. initial step towards implementing C string literals rm diag item, use lang item Merge commit '371120bdbf58a331db5dcfb2d9cddc040f486de8' into clippyup Make the BUG_REPORT_URL configurable by tools This greatly simplifies how hard it is to set a custom bug report url; previously tools had to copy the entire hook implementation. - Switch clippy to the new hook This also adds a `extra_info` callback so clippy can include its own version number, which differs from rustc's. - Call `install_ice_hook` in rustfmt make (try_)subst_and_normalize_erasing_regions take EarlyBinder changes from review: add FIXME to clippy and change subst_identity to skip_binder in mir subst methods IAT: Introduce AliasKind::Inherent Drop uplifted clippy::drop_ref Drop uplifted clippy::drop_copy Drop uplifted clippy::forget_ref Drop uplifted clippy::forget_copy Exposes false negative in clippy's diverging_sub_expression Remove `LangItems::require` It's just a short wrapper used by `tcx.require_lang_item`. Deleting it gives us a negative diff. Exclude inherent projections from some alias ty matches Merge commit '435a8ad86c7a33bd7ffb91c59039943408d3b6aa' into clippyup Rename `drop_copy` lint to `dropping_copy_types` Rename `forget_copy` lint to `forgetting_copy_types` Rename `drop_ref` lint to `dropping_references` Rename `forget_ref` lint to `forgetting_references` Replace EarlyBinder(x) with EarlyBinder::new(x) Make EarlyBinder's inner value private; and fix all of the resulting errors Use `Cow` in `{D,Subd}iagnosticMessage`. Each of `{D,Subd}iagnosticMessage::{Str,Eager}` has a comment: ``` // FIXME(davidtwco): can a `Cow<'static, str>` be used here? ``` This commit answers that question in the affirmative. It's not the most compelling change ever, but it might be worth merging. This requires changing the `impl<'a> From<&'a str>` impls to `impl From<&'static str>`, which involves a bunch of knock-on changes that require/result in call sites being a little more precise about exactly what kind of string they use to create errors, and not just `&str`. This will result in fewer unnecessary allocations, though this will not have any notable perf effects given that these are error paths. Note that I was lazy within Clippy, using `to_string` in a few places to preserve the existing string imprecision. I could have used `impl Into<{D,Subd}iagnosticMessage>` in various places as is done in the compiler, but that would have required changes to *many* call sites (mostly changing `&format("...")` to `format!("...")`) which didn't seem worthwhile. Drop uplifted clippy::invalid_utf8_in_unchecked EarlyBinder::new -> EarlyBinder::bind Drop uplifted clippy::cast_ref_to_mut Use translatable diagnostics in `rustc_const_eval` Implement custom diagnostic for ConstParamTy Merge commit '30448e8cf98d4754350db0c959644564f317bc0f' into clippyup Rename `impl_defaultness` to `defaultness` Removed stable/unstable sort arg from into_sorted_stable_ord, fixed a few misc issues, added collect to UnordItems Whoops, submodule change was actually valid - undoing fixup Drop uplifted clippy::undropped_manually_drops Drop uplifted `clippy:cmp_nan` Extend `unused_must_use` to cover block exprs Add `AliasKind::Weak` for type aliases. Only use it when the type alias contains an opaque type. Also does wf-checking on such type aliases. Move WF goal to clause Move ConstEvaluatable to Clause Treat TAIT equation as always ambiguous in coherence Better error for non const `PartialEq` call generated by `match` Make `{Arc,Rc,Weak}::ptr_eq` ignore pointer metadata s/Clause/ClauseKind Support `ast::ExprKind::Become` in clippy Migrate item_bounds to ty::Clause Do not offer any of the suggestions in emit_coerce_suggestions for expr from destructuring assignment desugaring Support `hir::ExprKind::Become` in clippy Migrate predicates_of and caller_bounds to Clause Provide more context for `rustc +nightly -Zunstable-options` on stable Make simd_shuffle_indices use valtrees Merge commit '37f4c1725d3fd7e9c3ffd8783246bc5589debc53' into clippyup Fix valtree changes Fix compile-test tests to work with the new ui_test crate Deal with fallout Patch clippy Move `TyCtxt::mk_x` to `Ty::new_x` where applicable Fix failing clippy tests Comments out the C string literals due to rust-lang/rust#113334 Fixes rust-lang#11121 Rename `adjustment::PointerCast` and variants using it to `PointerCoercion` It makes it sound like the `ExprKind` and `Rvalue` are supposed to represent all pointer related casts, when in reality their just used to share a some enum variants. Make it clear there these are only coercion to make it clear why only some pointer related "casts" are in the enum. Delete `to_string_in_format_args_incremental.rs` It fails CI and passes locally. It passes random directores in `-Cincremental` so maybe something's up. It shouldn't block us here. Drop uplifted `clippy::fn_null_check` Ignore flaky clippy tests. Suggest the correct variable name for `manual_let_else` Split if conditions by its semantics Remove old feature flag in code comment Since let_else feature has been stable in 1.65.0, it's now unnecessary Avoid renaming for TupleStruct with multiple arguments update spec fix: move specs in fire Fix: Some suggestions generated by the option_if_let_else lint did not compile bump up `regex-syntax` dependency version to 0.7.0 Ignoring `let_underscore_untyped` warnings in code from proc macros fixing fmt Checking for proc_macro not only when local.init is Some Remove unnecessary from example fix example heading in `string_slice` don't remove `dbg!` in arbitrary expressions handle nested macros and add tests for them Rename integer_arithmetic redundant_pattern_matching redundant_pattern_matching fix conflict with matches macro fix conflict with matches macro fix error test update a func fix reviewer comments fix reviewer comments: tests results update tests update test option Don't suggest unnameable types in box_default, let_underscore_untyped Search for inactive `cfg` attributes and empty macro expansion through the entire block Slightly refactor constant evaluation and add detection for empty macro expansion and `cfg`ed statements. Improve `SpanlessEq` * Don't consider expansions of different macros to be the same, even if they expand to the same tokens * Don't consider `cfg!` expansions to be equal if they check different configs. enhance `needless_collect` Updates `needless_collect` to lint for collecting into a method or function argument thats taking an `IntoIterator` (for example `extend`). Every `Iterator` trivially implements `IntoIterator` and colleting it only causes an unnecessary allocation. Add new `UNIQUE_CFG_CONDITION` lint Add UI test for UNIQUE_CFG_CONDITION Update CHANGELOG Add check for empty cfg `all` condition Update urls in Type Checking Bump nightly version -> 2023-05-20 [`match_wild_err_arm`]: do not lint in const contexts consider array initializer for `large_stack_arrays` add test case for rust-lang#10741 Unit tests highlighting unsafe match issue These unit tests generate non-compilable code. I did NOT `bless` them on purpose because the stderr output is not good. I'm surprised we don't auto-compile the suggestions here - is this something that can be easily enabled? See rust-lang#10808 Fix unsafe blocks Use #[rustfmt::skip] remove todo Run-rustfix needless_else: new lint to check for empty else clauses the implementation!! check msrv Update clippy_lints/src/casts/ptr_cast_constness.rs Co-authored-by: llogiq <[email protected]> add description and rename msrv tests change `clippy::version` to 1.71.0 Display the `needless_return` suggestion error out if lint name contains dash replace `-` instead of erroring out apply suggestion Co-authored-by: Philipp Krones <[email protected]> Address Dependabot alerts do not consider `await` in nested `async` blocks remove old span_lint point to `await` expr in note redundant pattern matches! result [`default_constructed_unit_structs`]: do not lint type aliases Ignore #[cfg]'d out code in needless_else Fix formatting of if let chain Some improvements to the manual_let_else lint suggestions * Replace variables inside | patterns in the if let: let v = if let V::A(v) | V::B(v) = v { v } else ... * Support nested patterns: let v = if let Ok(Ok(Ok(v))) = v { v } else ... * Support tuple structs with more than one arg: let v = V::W(v, _) = v { v } else ... * Correctly handle .. in tuple struct patterns: let v = V::X(v, ..) = v { v } else ... Fixing `invalid_regex` with invalid UTF8. Also, adding more test cases Update version attribute for 1.70 lints Changelog for Rust 1.70 🔨 Change changelog typos Co-authored-by: Takayuki Nakata <[email protected]> deps: drop serde feature from url actually, remove rustc-workspace-hack dependency too [`wildcard_imports`] Modules that contain `prelude` are also allowed This commit fixes rust-lang#10846 by checking if the path segment contains the word "prelude". Signed-off-by: Charalampos Mitrodimas <[email protected]> fix issues 10836 change booleans file and update tests Remove lint name and category fields from the new lint issue form new lint: `missing_field_in_debug` move some strings into consts, more tests s/missing_field_in_debug/missing_fields_in_debug dont trigger in macro expansions make dogfood tests happy minor cleanups replace HashSet with FxHashSet replace match_def_path with match_type if_chain -> let chains, fix markdown, allow newtype pattern fmt consider string literal in `.field()` calls as used don't intern defined symbol, remove mentions of 'debug_tuple' special-case PD, account for field access through `Deref` don't lint enums, update note in lint description Explain which paths clippy searches for configuration in docs Explain path-search using a list Add spans to `clippy.toml` error messages Bump nightly version -> 2023-06-02 Bump Clippy version -> 0.1.72 add checking for cfg(features = ...) Update *Current stable* text in `CHANGELOG.md` Refresh Lint Configuration's looks emit `unnecessary_cast` on raw pointers as well ok actually appease CI I should always run cargo test before committing 😅 add generics in test also ensure generics with the same type are linted Use URL parameters for filter states This retains the settings during browser navigation and allows sharing links with additional configuration. Handle back/forward when using URL parameters for filter states Clippy Lints page - Delay updating of the URL in response to search input Update on blur, enter keypress, and a debounced delay of 1000 ms. This keeps the URL updated, but not distractingly so. Clippy Lints page - Do not show groups in URL parameters if reset to defaults Clippy Lints page - Fix path watch triggering Clippy Lints page - Do not show filters in URL if configured as default values only lint when `cast_from` and `cast_to`'s ty are the same weird manual_let_else: only add () around PatKind::Or at the top level At the top level, () are required, but on the levels below they are not. Support multi-binding situations as well as tuple patterns Support struct patterns new lint: `explicit_into_iter_fn_arg` dogfood update docs, simplify arg->param map, dont lint on chain merge `explicit_into_iter_fn_arg` into `useless_conversion` fix new failing proc macro tests add plural form to useless_conversion if depth > 0 Add lint to check lint formulation messages Fix lints that don't conform to the standard formulation refactor(test): Move attribute to lint level Fix suggestion on fully qualified syntax ignore `Foo::deref` altogether Add from_over_into replace for type in `Self` reference Ignore from_over_into if it contains Self Move bail into lint to prevent no-linting, move to unfixable don't lint `allow_attributes` on attributes from proc macros foiled again (forgot to run cargo test) Fix `attr_search_pat` for `#[cfg_attr]` remove tuple add test for `?` desugaring Update allow_attributes_without_reason.rs `to_xx_bytes` implemented, `from_xx_bytes` todo Mentioned in rust-lang#10765 implement `host_endian_bytes` and the other two weird grammar refine output unidiomatic `if_chain!` don't allocate the names use enum for `prefix` instead of `&str` Update endian_bytes.rs derive Copy/PartialEq for `Prefix` Remove `CARGO_UNSTABLE_SPARSE_REGISTRY` env from ci It is now the default to use the sparse registry Move redundant_clone to nursery Add a test that checks for old style test headers [`unnecessary_lazy_eval`]: don't lint on types with deref impl Bring up Rust lang #37612 as a known problem for let_and_return Compact issue link Co-authored-by: Takayuki Nakata <[email protected]> Add redundant type annotations lint Move `redundant_type_annotations` to restriction Extract common logic to function Add support to returned refs from `MethodCall` Add `Limitations` section make cast_possible_wrap not lint on conversions for sizes that cannot wrap, and make it work correctly for 16 bit {u,i}size add more info link Fix rust-lang#10498 Use type snippet instead of init expr for proc macro check check for `_` instead account for autoderef in eager_or_lazy don't call `type_of` on generic params Don't warn if there is a comment between else and curly bracket make `useless_vec` smarter allow the lint in a bunch of tests don't allow `as_slice` for now Adds new lint `arc_with_non_send_or_sync` Updating documentation and lint formatting. Adding extra check to ignore generic args. Swapping to matches macro. handle RangeInclusive function desugar actually don't lint for inclusive range Fix `useless_vec` suggestion in `for _ in vec![..]` Ignore more pointer types in `unnecessary_cast` check that the adjusted receiver type matches target add the `excessive_*` style lints change it to nursery category add `excessive_nesting` Close code block in example couple more notes decided against reinventing the wheel check non-inline modules, ignore all macros work with lint attributes move to `complexity` but don't lint by default Check if from proc macro and better tests remove revisions fix rust-lang#10776 actually fix it also lint single expression blocks Update mixed_read_write_in_expression.rs Update diverging_sub_expression.stderr ensure there are no stmts for expr check refactor Update excessive_nesting.rs Update excessive_nesting.rs allow disabling module inception on private modules allow disabling module inception on private modules Direct towards late passes in `cargo dev new_lint` handle exponent without digits add test ignore more type aliases in unnecessary_cast ignore more type aliases in unnecessary_cast Update unnecessary_cast.stderr Add `needless_if` lint make cargo test pass add description add description don't lint on `if let` don't lint on `if let` Update needless_if.fixed Stop visiting once it's found `Let` Extend `explicit_iter_loop` to all types Split `for_loops` tests Fix `explicit_into_iter_loop` with mutable references Reborrow mutable references in `explicit_iter_loop` Fix rust-lang#10504, don't lint on derived code refactor Update trait_bounds.rs `ty_search_pat` `impl WithSearchPat for Ty` Update check_proc_macro.rs Add lint `single_letter_idents` rename the lint make cargo test pass + example ignore generics and allow arbitrary threshold make it work for locals as well oopos add to tests and configuration `cargo collect-metadata` refactor and add link to issue new lint: `large_stack_frames` `cargo dev update_lints` fmt use span_lint_and_note rename "drawbacks" to "known issues" make lint description easier to read, prevent ICE fix rebase weirdness update lint_configuration.md Don't ling `as_conversions` in proc macros [`useless_vec`]: detect unnecessary `vec![_]` add- and fix existing tests Add test code Boilerplate for the new lint Add hook Add the lint to the lib Implement the lint Implement the lint for expect Implement the suggestion Recognize `Ok` Recognize `unwrap_or` methods Recognize `unwrap_or_else` method Track init and unwrap of expr Recognize `Err` Support suggesting panics Add more tests Preserve type annotations when present Fix all the other tests Don't lint non-statement/faux empty `needless_if`s Now `cargo collect-metadata` updates the `CHANGELOG.md` Remove dead code in `needless_pass_by_value` Fix `missing_const_for_fn` not checking `~const Destruct` use trait solver instead; created spaghetti code cleanup spaghetti code remove unnecessary checks remove `in_move` [`needless_lifetimes`]' suggestion now points at the lifetimes [`no_effect`]: suggest adding `return` if applicable make cargo test pass Revert "Make it `Unspecified`" This reverts commit 7748630. Make it `Unspecified` [`map_unwrap_or`]: don't lint when referenced variable is moved Ignore `main()` in `no_test` code fences run `cargo dev fmt` add main function to test itself [`derivable_impls`]: don't lint if expr unsize-coerces fmt dogfood fix internal lints Add lint [`single_range_in_vec_init`] refactor a bit [`unnecessary_fold`]: suggest turbofish if necessary get rid of unnecessary function pointer move check_fold_with_op function out from_over_into: Show suggestions for non-Self expanded paths [`match_same_arms`]: don't lint if `non_exhaustive_omitted_patterns` formatting :/ new lint: `drain_collect` take into account reborrowing when inserting `&mut` in sugg make clippy happy add a description add test case for not whole length, move sugg into variable add lint [`needless_clone_impl`] Update needless_impls.rs rename lint and disallow `clone_from` missing_panics_doc: pickup expect method bless address or allow clippy::missing_panics_doc in clippy-dev merge test improve grammer in comment sentence Co-authored-by: dswij <[email protected]> Refactor to make following commit pass single_match_else lint Make `--explain` subcommand return 1 for missing lints Ignore more type aliases in `unnecessary_cast` Adapt versions.html file to cleaned up gh-pages Fix version.py after deleting v* dirs I missed updating this file. I also ran black and isort over it. Adding configuration to allow safety comment above stmt containing unsafe block Addressing reviewer comments adding all ui tests to the configuration test as well Collecting metadata Exlude `todo!()` from `missing_panics_in_doc` `missing_panics_in_doc` bless test and add additional macro testcase new lint `single_call_fn` add test for closures Ignore functions annotated with `#[test]` Fix `find_format_arg_expr` when incremental compilation is enabled Fix rust-lang#10792 Dogfood Fix false positive of [self_named_module_files] and [mod_module_files] Move continue into if statement Co-authored-by: Catherine <[email protected]> [`redundant_closure_call`]: handle nested closures fix docs don't unnecessarily walk more in visitor and add more tests Ignore in-proc-macros items use PlaceRef abstractions add non-test-case for suggesting const on functions accessing union fields allow safety comment above attributes [`single_match`]: don't lint if block contains comments add test for block comment and add note to description Don't lint `excessive_precision` on inf Add WebAssembly to allowed idents add WebAssembly to test [`borrow_as_ptr`]: Ignore temporaries use rustc's criteria for a temporary Don't lint `iter_nth_zero` in `next` include a ref if argument is not just a numeric literal use let chains, move assignments out of block, add tests declare needs_ref later [`type_repetition_in_bounds`]: respect msrv for combining maybe bounds put issue link between <> rename MSRV alias, add MSRV to lint doc update lint configuration Don't lint `ptr_arg` when return type uses Cow's lifetime [`format_push_string`]: look through match, if, if-let Avoid linting on procedural macros Lint `mem_forget` if fields are `Drop` move to `drop_forget_ref` make note less verbose Check if `if` conditions always evaluate to true in `never_loop` update changelog's data ranges Port clippy away from compiletest to ui_test Update tests Find the right `cargo-clippy` binary in CI Don't lint code from external macros add `needless_raw_string_hashes` lint add semicolon in doctest new lint `needless_raw_string` + refactor a bit Thanks, #112373, for the snippet at line 75! Update raw_strings.rs don't lint `needless_raw_string_hashes` when it's unnecessary change category and refactor Update raw_strings.rs Revert "new lints for visibility" This reverts commit 0e5a537. new lints for visibility Fix compile-test under cargo nextest Add BLESS for compile-test and some cleanup new lint: `manual_range_pattern` manual_range_pattern -> manual_range_patterns Use substring matching for TESTNAME new lints for visibility Change category and update to `ui_test` [`unused_async`]: don't lint on async trait impls move `is_in_trait_method` to utils and rename [`option_if_let_else`]: suggest `.as_ref()` if `&Option<_>` allow dead code in the test [`question_mark`]: don't lint inside of `try` block lint in nested bodies if `try` is in outer body suggests `is_some_and` over `map().unwrap_or(false)` changed the msrv to 1.70 to suggest `is_some_and` if the msrv is not >= 1.70 then the `map_or` is suggested instead of `is_some_and` (even when `unwrap_or` returns false) now passes dogfood by wrapping unwrap_recv and unwrap_arg into a tuple was previously failing due to `check` having to many arguments. Revert "now passes dogfood by wrapping unwrap_recv and unwrap_arg into a tuple" This reverts commit 7b91844. ignore too_many_arguments on `check` changed msrv name for consistency & changed nested if for style updated list of lints that use msrv ran `cargo collect-metadata` New lint [`redundant_rest_pattern`] Rename the lint Add note to remove `if` statement altogether Fix rust-lang#10413 Dogfood Bump nightly version -> 2023-06-29 Make `eq_op` suggest `.is_nan()` New lint `tuple_array_conversions` Add msrv check and make test pass Fix FP heavily refactor New lint `manual_try_fold` Add msrv tests Typo update docs address comments Fix typos Use `cargo build --tests` in CI let_and_return: lint 'static lifetimes, don't lint borrows in closures Add `SPEEDTEST` Fix dogfood Finally fix dogfood [`missing_fields_in_debug`]: make sure `self` is an adt new lint: `type_id_on_box` that was definitely not the right version add it to the methods lint pass add a few more test cases s/is_dyn_trait/is_dyn_any [`arc_with_non_send_sync`]: look for nested type parameters [`useless_vec`]: use the source span Don't lint manual_let_else in cases where the question mark operator would work Also, lint question_mark for `let...else` clauses that can be simplified to use `?`. This lint isn't perfect as it doesn't support the unstable try blocks. Fix the now stricter lint in manual_rem_euclid.rs Put into one pass Don't suppress manual_let_else if question_mark is allowed If question_mark is allowed, there is no overlap any more, so we can just not suppress it. Move pat_and_expr_can_be_question_mark into clippy_utils Fix FP [`needless_raw_string_hashes`] [`useless_vec`]: add more tests for macro combinations new lint: `read_line_without_trim` add test cases for u32, f32, bool, String Fix regex lints for regex 1.9.0 arc_with_non_send_sync: reword and move to suspicious Pass correct substs to `implements_trait` in `incorrect_impls` `Copy<T>` does in fact not exist. The substs on the trait_ref contain the `Self` type of the impl as the first parameter, so passing that to `implements_trait`, which then nicely prepends the `Self` type for us does not end will. Fix changelog PR listings, create them automatically in `fetch_prs_between.sh` implement `manual_partial_ord_impl` first try at this rename to `manual_partial_ord_and_ord_impl` cargo dev fmt cargo test passes cargo test passes refactor a lil Update bool_comparison.stderr heavily refactor + bump `clippy::version` refactor refactor check bounds to increase accuracy, and add todos use `other` instead of `self` refactor `manual_float_methods` Make suggestion give multiple alternatives Refactor, remove `Constant::to_bits` [significant_drop_tightening] Fix rust-lang#11128 Dogfood Add test for rust-lang#10535 Fix rust-lang#10535 Add needless_pass_by_ref lint Add UI test for `needless_pass_by_ref_mut` Update UI tests with new `needless_pass_by_ref_mut` lint Fix warnings of `needless_pass_by_ref_mut` in clippy Add warning for `NEEDLESS_PASS_BY_REF_MUT` lint about the fact that it changes API Add warning about semver compatibility if it's a public function "try this" -> "try" [`unnecessary_literal_unwrap`]: don't lint if binding initializer is expn [`manual_range_patterns`]: lint negative values [`manual_range_patterns`]: document what range we don't lint changelog: Fix typo in `needless_pass_by_ref_mut` lint description adjust applicability and suggest making binding mutable Use depinfo to discover UI test dependencies [`unnecessary_literal_unwrap`]: lint `unwrap_unchecked` [`unnecessary_literal_unwrap`]: also handle unwrap_err_unchecked Update version attribute for 1.71 lints Changelog for Rust 1.71 👑 Changelog: Add disclaimer about the new format [`panic_in_result_fn`] remove `todo!`, `unimplemented!`, `unreachable!` This commit fixes rust-lang#11025 by removing checks for `todo!`, `unimplemented!` and `unreachable!`. Signed-off-by: Panagiotis Foliadis <[email protected]> Add "Known problems" section to `needless_borrow` documentation [`tuple_array_conversions`]: move from `complexity` to `nursery` Due to outstanding issues: * rust-lang#11082 * rust-lang#11085 * rust-lang#11100 (rust-lang#11105) * rust-lang#11124 * rust-lang#11144 [`arithmetic_side_effect`]: allow different rhs type Add `imports_granularity = "Module"` to rustfmt.toml Trigger a rebuild when CLIPPY_CONF_DIR changes Set `unnecessary_cast` suggestion to `MaybeIncorrect` for pointer casts Removing casts may cause type inference to stop working which requires manual intervention Bump Clippy version -> 0.1.73 Bump nightly version -> 2023-07-14 renamed lint rebase attempt
ofeeg
added a commit
to ofeeg/rust-clippy
that referenced
this pull request
Aug 15, 2023
initial step towards implementing C string literals rm diag item, use lang item Merge commit '371120bdbf58a331db5dcfb2d9cddc040f486de8' into clippyup Make the BUG_REPORT_URL configurable by tools This greatly simplifies how hard it is to set a custom bug report url; previously tools had to copy the entire hook implementation. - Switch clippy to the new hook This also adds a `extra_info` callback so clippy can include its own version number, which differs from rustc's. - Call `install_ice_hook` in rustfmt make (try_)subst_and_normalize_erasing_regions take EarlyBinder changes from review: add FIXME to clippy and change subst_identity to skip_binder in mir subst methods IAT: Introduce AliasKind::Inherent Drop uplifted clippy::drop_ref Drop uplifted clippy::drop_copy Drop uplifted clippy::forget_ref Drop uplifted clippy::forget_copy Exposes false negative in clippy's diverging_sub_expression Remove `LangItems::require` It's just a short wrapper used by `tcx.require_lang_item`. Deleting it gives us a negative diff. Exclude inherent projections from some alias ty matches Merge commit '435a8ad86c7a33bd7ffb91c59039943408d3b6aa' into clippyup Rename `drop_copy` lint to `dropping_copy_types` Rename `forget_copy` lint to `forgetting_copy_types` Rename `drop_ref` lint to `dropping_references` Rename `forget_ref` lint to `forgetting_references` Replace EarlyBinder(x) with EarlyBinder::new(x) Make EarlyBinder's inner value private; and fix all of the resulting errors Use `Cow` in `{D,Subd}iagnosticMessage`. Each of `{D,Subd}iagnosticMessage::{Str,Eager}` has a comment: ``` // FIXME(davidtwco): can a `Cow<'static, str>` be used here? ``` This commit answers that question in the affirmative. It's not the most compelling change ever, but it might be worth merging. This requires changing the `impl<'a> From<&'a str>` impls to `impl From<&'static str>`, which involves a bunch of knock-on changes that require/result in call sites being a little more precise about exactly what kind of string they use to create errors, and not just `&str`. This will result in fewer unnecessary allocations, though this will not have any notable perf effects given that these are error paths. Note that I was lazy within Clippy, using `to_string` in a few places to preserve the existing string imprecision. I could have used `impl Into<{D,Subd}iagnosticMessage>` in various places as is done in the compiler, but that would have required changes to *many* call sites (mostly changing `&format("...")` to `format!("...")`) which didn't seem worthwhile. Drop uplifted clippy::invalid_utf8_in_unchecked EarlyBinder::new -> EarlyBinder::bind Drop uplifted clippy::cast_ref_to_mut Use translatable diagnostics in `rustc_const_eval` Implement custom diagnostic for ConstParamTy Merge commit '30448e8cf98d4754350db0c959644564f317bc0f' into clippyup Rename `impl_defaultness` to `defaultness` Removed stable/unstable sort arg from into_sorted_stable_ord, fixed a few misc issues, added collect to UnordItems Whoops, submodule change was actually valid - undoing fixup Drop uplifted clippy::undropped_manually_drops Drop uplifted `clippy:cmp_nan` Extend `unused_must_use` to cover block exprs Add `AliasKind::Weak` for type aliases. Only use it when the type alias contains an opaque type. Also does wf-checking on such type aliases. Move WF goal to clause Move ConstEvaluatable to Clause Treat TAIT equation as always ambiguous in coherence Better error for non const `PartialEq` call generated by `match` Make `{Arc,Rc,Weak}::ptr_eq` ignore pointer metadata s/Clause/ClauseKind Support `ast::ExprKind::Become` in clippy Migrate item_bounds to ty::Clause Do not offer any of the suggestions in emit_coerce_suggestions for expr from destructuring assignment desugaring Support `hir::ExprKind::Become` in clippy Migrate predicates_of and caller_bounds to Clause Provide more context for `rustc +nightly -Zunstable-options` on stable Make simd_shuffle_indices use valtrees Merge commit '37f4c1725d3fd7e9c3ffd8783246bc5589debc53' into clippyup Fix valtree changes Fix compile-test tests to work with the new ui_test crate Deal with fallout Patch clippy Move `TyCtxt::mk_x` to `Ty::new_x` where applicable Fix failing clippy tests Comments out the C string literals due to rust-lang/rust#113334 Fixes rust-lang#11121 Rename `adjustment::PointerCast` and variants using it to `PointerCoercion` It makes it sound like the `ExprKind` and `Rvalue` are supposed to represent all pointer related casts, when in reality their just used to share a some enum variants. Make it clear there these are only coercion to make it clear why only some pointer related "casts" are in the enum. Delete `to_string_in_format_args_incremental.rs` It fails CI and passes locally. It passes random directores in `-Cincremental` so maybe something's up. It shouldn't block us here. Drop uplifted `clippy::fn_null_check` Ignore flaky clippy tests. Suggest the correct variable name for `manual_let_else` Split if conditions by its semantics Remove old feature flag in code comment Since let_else feature has been stable in 1.65.0, it's now unnecessary Avoid renaming for TupleStruct with multiple arguments update spec fix: move specs in fire Fix: Some suggestions generated by the option_if_let_else lint did not compile bump up `regex-syntax` dependency version to 0.7.0 Ignoring `let_underscore_untyped` warnings in code from proc macros fixing fmt Checking for proc_macro not only when local.init is Some Remove unnecessary from example fix example heading in `string_slice` don't remove `dbg!` in arbitrary expressions handle nested macros and add tests for them Rename integer_arithmetic redundant_pattern_matching redundant_pattern_matching fix conflict with matches macro fix conflict with matches macro fix error test update a func fix reviewer comments fix reviewer comments: tests results update tests update test option Don't suggest unnameable types in box_default, let_underscore_untyped Search for inactive `cfg` attributes and empty macro expansion through the entire block Slightly refactor constant evaluation and add detection for empty macro expansion and `cfg`ed statements. Improve `SpanlessEq` * Don't consider expansions of different macros to be the same, even if they expand to the same tokens * Don't consider `cfg!` expansions to be equal if they check different configs. enhance `needless_collect` Updates `needless_collect` to lint for collecting into a method or function argument thats taking an `IntoIterator` (for example `extend`). Every `Iterator` trivially implements `IntoIterator` and colleting it only causes an unnecessary allocation. Add new `UNIQUE_CFG_CONDITION` lint Add UI test for UNIQUE_CFG_CONDITION Update CHANGELOG Add check for empty cfg `all` condition Update urls in Type Checking Bump nightly version -> 2023-05-20 [`match_wild_err_arm`]: do not lint in const contexts consider array initializer for `large_stack_arrays` add test case for rust-lang#10741 Unit tests highlighting unsafe match issue These unit tests generate non-compilable code. I did NOT `bless` them on purpose because the stderr output is not good. I'm surprised we don't auto-compile the suggestions here - is this something that can be easily enabled? See rust-lang#10808 Fix unsafe blocks Use #[rustfmt::skip] remove todo Run-rustfix needless_else: new lint to check for empty else clauses the implementation!! check msrv Update clippy_lints/src/casts/ptr_cast_constness.rs Co-authored-by: llogiq <[email protected]> add description and rename msrv tests change `clippy::version` to 1.71.0 Display the `needless_return` suggestion error out if lint name contains dash replace `-` instead of erroring out apply suggestion Co-authored-by: Philipp Krones <[email protected]> Address Dependabot alerts do not consider `await` in nested `async` blocks remove old span_lint point to `await` expr in note redundant pattern matches! result [`default_constructed_unit_structs`]: do not lint type aliases Ignore #[cfg]'d out code in needless_else Fix formatting of if let chain Some improvements to the manual_let_else lint suggestions * Replace variables inside | patterns in the if let: let v = if let V::A(v) | V::B(v) = v { v } else ... * Support nested patterns: let v = if let Ok(Ok(Ok(v))) = v { v } else ... * Support tuple structs with more than one arg: let v = V::W(v, _) = v { v } else ... * Correctly handle .. in tuple struct patterns: let v = V::X(v, ..) = v { v } else ... Fixing `invalid_regex` with invalid UTF8. Also, adding more test cases Update version attribute for 1.70 lints Changelog for Rust 1.70 🔨 Change changelog typos Co-authored-by: Takayuki Nakata <[email protected]> deps: drop serde feature from url actually, remove rustc-workspace-hack dependency too [`wildcard_imports`] Modules that contain `prelude` are also allowed This commit fixes rust-lang#10846 by checking if the path segment contains the word "prelude". Signed-off-by: Charalampos Mitrodimas <[email protected]> fix issues 10836 change booleans file and update tests Remove lint name and category fields from the new lint issue form new lint: `missing_field_in_debug` move some strings into consts, more tests s/missing_field_in_debug/missing_fields_in_debug dont trigger in macro expansions make dogfood tests happy minor cleanups replace HashSet with FxHashSet replace match_def_path with match_type if_chain -> let chains, fix markdown, allow newtype pattern fmt consider string literal in `.field()` calls as used don't intern defined symbol, remove mentions of 'debug_tuple' special-case PD, account for field access through `Deref` don't lint enums, update note in lint description Explain which paths clippy searches for configuration in docs Explain path-search using a list Add spans to `clippy.toml` error messages Bump nightly version -> 2023-06-02 Bump Clippy version -> 0.1.72 add checking for cfg(features = ...) Update *Current stable* text in `CHANGELOG.md` Refresh Lint Configuration's looks emit `unnecessary_cast` on raw pointers as well ok actually appease CI I should always run cargo test before committing 😅 add generics in test also ensure generics with the same type are linted Use URL parameters for filter states This retains the settings during browser navigation and allows sharing links with additional configuration. Handle back/forward when using URL parameters for filter states Clippy Lints page - Delay updating of the URL in response to search input Update on blur, enter keypress, and a debounced delay of 1000 ms. This keeps the URL updated, but not distractingly so. Clippy Lints page - Do not show groups in URL parameters if reset to defaults Clippy Lints page - Fix path watch triggering Clippy Lints page - Do not show filters in URL if configured as default values only lint when `cast_from` and `cast_to`'s ty are the same weird manual_let_else: only add () around PatKind::Or at the top level At the top level, () are required, but on the levels below they are not. Support multi-binding situations as well as tuple patterns Support struct patterns new lint: `explicit_into_iter_fn_arg` dogfood update docs, simplify arg->param map, dont lint on chain merge `explicit_into_iter_fn_arg` into `useless_conversion` fix new failing proc macro tests add plural form to useless_conversion if depth > 0 Add lint to check lint formulation messages Fix lints that don't conform to the standard formulation refactor(test): Move attribute to lint level Fix suggestion on fully qualified syntax ignore `Foo::deref` altogether Add from_over_into replace for type in `Self` reference Ignore from_over_into if it contains Self Move bail into lint to prevent no-linting, move to unfixable don't lint `allow_attributes` on attributes from proc macros foiled again (forgot to run cargo test) Fix `attr_search_pat` for `#[cfg_attr]` remove tuple add test for `?` desugaring Update allow_attributes_without_reason.rs `to_xx_bytes` implemented, `from_xx_bytes` todo Mentioned in rust-lang#10765 implement `host_endian_bytes` and the other two weird grammar refine output unidiomatic `if_chain!` don't allocate the names use enum for `prefix` instead of `&str` Update endian_bytes.rs derive Copy/PartialEq for `Prefix` Remove `CARGO_UNSTABLE_SPARSE_REGISTRY` env from ci It is now the default to use the sparse registry Move redundant_clone to nursery Add a test that checks for old style test headers [`unnecessary_lazy_eval`]: don't lint on types with deref impl Bring up Rust lang #37612 as a known problem for let_and_return Compact issue link Co-authored-by: Takayuki Nakata <[email protected]> Add redundant type annotations lint Move `redundant_type_annotations` to restriction Extract common logic to function Add support to returned refs from `MethodCall` Add `Limitations` section make cast_possible_wrap not lint on conversions for sizes that cannot wrap, and make it work correctly for 16 bit {u,i}size add more info link Fix rust-lang#10498 Use type snippet instead of init expr for proc macro check check for `_` instead account for autoderef in eager_or_lazy don't call `type_of` on generic params Don't warn if there is a comment between else and curly bracket make `useless_vec` smarter allow the lint in a bunch of tests don't allow `as_slice` for now Adds new lint `arc_with_non_send_or_sync` Updating documentation and lint formatting. Adding extra check to ignore generic args. Swapping to matches macro. handle RangeInclusive function desugar actually don't lint for inclusive range Fix `useless_vec` suggestion in `for _ in vec![..]` Ignore more pointer types in `unnecessary_cast` check that the adjusted receiver type matches target add the `excessive_*` style lints change it to nursery category add `excessive_nesting` Close code block in example couple more notes decided against reinventing the wheel check non-inline modules, ignore all macros work with lint attributes move to `complexity` but don't lint by default Check if from proc macro and better tests remove revisions fix rust-lang#10776 actually fix it also lint single expression blocks Update mixed_read_write_in_expression.rs Update diverging_sub_expression.stderr ensure there are no stmts for expr check refactor Update excessive_nesting.rs Update excessive_nesting.rs allow disabling module inception on private modules allow disabling module inception on private modules Direct towards late passes in `cargo dev new_lint` handle exponent without digits add test ignore more type aliases in unnecessary_cast ignore more type aliases in unnecessary_cast Update unnecessary_cast.stderr Add `needless_if` lint make cargo test pass add description add description don't lint on `if let` don't lint on `if let` Update needless_if.fixed Stop visiting once it's found `Let` Extend `explicit_iter_loop` to all types Split `for_loops` tests Fix `explicit_into_iter_loop` with mutable references Reborrow mutable references in `explicit_iter_loop` Fix rust-lang#10504, don't lint on derived code refactor Update trait_bounds.rs `ty_search_pat` `impl WithSearchPat for Ty` Update check_proc_macro.rs Add lint `single_letter_idents` rename the lint make cargo test pass + example ignore generics and allow arbitrary threshold make it work for locals as well oopos add to tests and configuration `cargo collect-metadata` refactor and add link to issue new lint: `large_stack_frames` `cargo dev update_lints` fmt use span_lint_and_note rename "drawbacks" to "known issues" make lint description easier to read, prevent ICE fix rebase weirdness update lint_configuration.md Don't ling `as_conversions` in proc macros [`useless_vec`]: detect unnecessary `vec![_]` add- and fix existing tests Add test code Boilerplate for the new lint Add hook Add the lint to the lib Implement the lint Implement the lint for expect Implement the suggestion Recognize `Ok` Recognize `unwrap_or` methods Recognize `unwrap_or_else` method Track init and unwrap of expr Recognize `Err` Support suggesting panics Add more tests Preserve type annotations when present Fix all the other tests Don't lint non-statement/faux empty `needless_if`s Now `cargo collect-metadata` updates the `CHANGELOG.md` Remove dead code in `needless_pass_by_value` Fix `missing_const_for_fn` not checking `~const Destruct` use trait solver instead; created spaghetti code cleanup spaghetti code remove unnecessary checks remove `in_move` [`needless_lifetimes`]' suggestion now points at the lifetimes [`no_effect`]: suggest adding `return` if applicable make cargo test pass Revert "Make it `Unspecified`" This reverts commit 7748630. Make it `Unspecified` [`map_unwrap_or`]: don't lint when referenced variable is moved Ignore `main()` in `no_test` code fences run `cargo dev fmt` add main function to test itself [`derivable_impls`]: don't lint if expr unsize-coerces fmt dogfood fix internal lints Add lint [`single_range_in_vec_init`] refactor a bit [`unnecessary_fold`]: suggest turbofish if necessary get rid of unnecessary function pointer move check_fold_with_op function out from_over_into: Show suggestions for non-Self expanded paths [`match_same_arms`]: don't lint if `non_exhaustive_omitted_patterns` formatting :/ new lint: `drain_collect` take into account reborrowing when inserting `&mut` in sugg make clippy happy add a description add test case for not whole length, move sugg into variable add lint [`needless_clone_impl`] Update needless_impls.rs rename lint and disallow `clone_from` missing_panics_doc: pickup expect method bless address or allow clippy::missing_panics_doc in clippy-dev merge test improve grammer in comment sentence Co-authored-by: dswij <[email protected]> Refactor to make following commit pass single_match_else lint Make `--explain` subcommand return 1 for missing lints Ignore more type aliases in `unnecessary_cast` Adapt versions.html file to cleaned up gh-pages Fix version.py after deleting v* dirs I missed updating this file. I also ran black and isort over it. Adding configuration to allow safety comment above stmt containing unsafe block Addressing reviewer comments adding all ui tests to the configuration test as well Collecting metadata Exlude `todo!()` from `missing_panics_in_doc` `missing_panics_in_doc` bless test and add additional macro testcase new lint `single_call_fn` add test for closures Ignore functions annotated with `#[test]` Fix `find_format_arg_expr` when incremental compilation is enabled Fix rust-lang#10792 Dogfood Fix false positive of [self_named_module_files] and [mod_module_files] Move continue into if statement Co-authored-by: Catherine <[email protected]> [`redundant_closure_call`]: handle nested closures fix docs don't unnecessarily walk more in visitor and add more tests Ignore in-proc-macros items use PlaceRef abstractions add non-test-case for suggesting const on functions accessing union fields allow safety comment above attributes [`single_match`]: don't lint if block contains comments add test for block comment and add note to description Don't lint `excessive_precision` on inf Add WebAssembly to allowed idents add WebAssembly to test [`borrow_as_ptr`]: Ignore temporaries use rustc's criteria for a temporary Don't lint `iter_nth_zero` in `next` include a ref if argument is not just a numeric literal use let chains, move assignments out of block, add tests declare needs_ref later [`type_repetition_in_bounds`]: respect msrv for combining maybe bounds put issue link between <> rename MSRV alias, add MSRV to lint doc update lint configuration Don't lint `ptr_arg` when return type uses Cow's lifetime [`format_push_string`]: look through match, if, if-let Avoid linting on procedural macros Lint `mem_forget` if fields are `Drop` move to `drop_forget_ref` make note less verbose Check if `if` conditions always evaluate to true in `never_loop` update changelog's data ranges Port clippy away from compiletest to ui_test Update tests Find the right `cargo-clippy` binary in CI Don't lint code from external macros add `needless_raw_string_hashes` lint add semicolon in doctest new lint `needless_raw_string` + refactor a bit Thanks, #112373, for the snippet at line 75! Update raw_strings.rs don't lint `needless_raw_string_hashes` when it's unnecessary change category and refactor Update raw_strings.rs Revert "new lints for visibility" This reverts commit 0e5a537. new lints for visibility Fix compile-test under cargo nextest Add BLESS for compile-test and some cleanup new lint: `manual_range_pattern` manual_range_pattern -> manual_range_patterns Use substring matching for TESTNAME new lints for visibility Change category and update to `ui_test` [`unused_async`]: don't lint on async trait impls move `is_in_trait_method` to utils and rename [`option_if_let_else`]: suggest `.as_ref()` if `&Option<_>` allow dead code in the test [`question_mark`]: don't lint inside of `try` block lint in nested bodies if `try` is in outer body suggests `is_some_and` over `map().unwrap_or(false)` changed the msrv to 1.70 to suggest `is_some_and` if the msrv is not >= 1.70 then the `map_or` is suggested instead of `is_some_and` (even when `unwrap_or` returns false) now passes dogfood by wrapping unwrap_recv and unwrap_arg into a tuple was previously failing due to `check` having to many arguments. Revert "now passes dogfood by wrapping unwrap_recv and unwrap_arg into a tuple" This reverts commit 7b91844. ignore too_many_arguments on `check` changed msrv name for consistency & changed nested if for style updated list of lints that use msrv ran `cargo collect-metadata` New lint [`redundant_rest_pattern`] Rename the lint Add note to remove `if` statement altogether Fix rust-lang#10413 Dogfood Bump nightly version -> 2023-06-29 Make `eq_op` suggest `.is_nan()` New lint `tuple_array_conversions` Add msrv check and make test pass Fix FP heavily refactor New lint `manual_try_fold` Add msrv tests Typo update docs address comments Fix typos Use `cargo build --tests` in CI let_and_return: lint 'static lifetimes, don't lint borrows in closures Add `SPEEDTEST` Fix dogfood Finally fix dogfood [`missing_fields_in_debug`]: make sure `self` is an adt new lint: `type_id_on_box` that was definitely not the right version add it to the methods lint pass add a few more test cases s/is_dyn_trait/is_dyn_any [`arc_with_non_send_sync`]: look for nested type parameters [`useless_vec`]: use the source span Don't lint manual_let_else in cases where the question mark operator would work Also, lint question_mark for `let...else` clauses that can be simplified to use `?`. This lint isn't perfect as it doesn't support the unstable try blocks. Fix the now stricter lint in manual_rem_euclid.rs Put into one pass Don't suppress manual_let_else if question_mark is allowed If question_mark is allowed, there is no overlap any more, so we can just not suppress it. Move pat_and_expr_can_be_question_mark into clippy_utils Fix FP [`needless_raw_string_hashes`] [`useless_vec`]: add more tests for macro combinations new lint: `read_line_without_trim` add test cases for u32, f32, bool, String Fix regex lints for regex 1.9.0 arc_with_non_send_sync: reword and move to suspicious Pass correct substs to `implements_trait` in `incorrect_impls` `Copy<T>` does in fact not exist. The substs on the trait_ref contain the `Self` type of the impl as the first parameter, so passing that to `implements_trait`, which then nicely prepends the `Self` type for us does not end will. Fix changelog PR listings, create them automatically in `fetch_prs_between.sh` implement `manual_partial_ord_impl` first try at this rename to `manual_partial_ord_and_ord_impl` cargo dev fmt cargo test passes cargo test passes refactor a lil Update bool_comparison.stderr heavily refactor + bump `clippy::version` refactor refactor check bounds to increase accuracy, and add todos use `other` instead of `self` refactor `manual_float_methods` Make suggestion give multiple alternatives Refactor, remove `Constant::to_bits` [significant_drop_tightening] Fix rust-lang#11128 Dogfood Add test for rust-lang#10535 Fix rust-lang#10535 Add needless_pass_by_ref lint Add UI test for `needless_pass_by_ref_mut` Update UI tests with new `needless_pass_by_ref_mut` lint Fix warnings of `needless_pass_by_ref_mut` in clippy Add warning for `NEEDLESS_PASS_BY_REF_MUT` lint about the fact that it changes API Add warning about semver compatibility if it's a public function "try this" -> "try" [`unnecessary_literal_unwrap`]: don't lint if binding initializer is expn [`manual_range_patterns`]: lint negative values [`manual_range_patterns`]: document what range we don't lint changelog: Fix typo in `needless_pass_by_ref_mut` lint description adjust applicability and suggest making binding mutable Use depinfo to discover UI test dependencies [`unnecessary_literal_unwrap`]: lint `unwrap_unchecked` [`unnecessary_literal_unwrap`]: also handle unwrap_err_unchecked Update version attribute for 1.71 lints Changelog for Rust 1.71 👑 Changelog: Add disclaimer about the new format [`panic_in_result_fn`] remove `todo!`, `unimplemented!`, `unreachable!` This commit fixes rust-lang#11025 by removing checks for `todo!`, `unimplemented!` and `unreachable!`. Signed-off-by: Panagiotis Foliadis <[email protected]> Add "Known problems" section to `needless_borrow` documentation [`tuple_array_conversions`]: move from `complexity` to `nursery` Due to outstanding issues: * rust-lang#11082 * rust-lang#11085 * rust-lang#11100 (rust-lang#11105) * rust-lang#11124 * rust-lang#11144 [`arithmetic_side_effect`]: allow different rhs type Add `imports_granularity = "Module"` to rustfmt.toml Trigger a rebuild when CLIPPY_CONF_DIR changes Set `unnecessary_cast` suggestion to `MaybeIncorrect` for pointer casts Removing casts may cause type inference to stop working which requires manual intervention Bump Clippy version -> 0.1.73 Bump nightly version -> 2023-07-14 renamed lint
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-testsuite
Area: The testsuite used to check the correctness of rustc
beta-accepted
Accepted for backporting to the compiler in the beta channel.
F-c_str_literals
`#![feature(c_str_literals)]`
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-bootstrap
Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes [after beta-backport] #113235.
Further progress is tracked in #113333.
This PR manually reverts parts of #108801 (since a git-revert would've been too coarse-grained & messy)
and git-reverts #111647.
CC @fee1-dead (#108801) @klensy (#111647)
r? @compiler-errors
@rustbot label F-c_str_literals beta-nominated