Commit Graph

242199 Commits

Author SHA1 Message Date
bors
03b50195ab Auto merge of #119421 - matthiaskrgr:rollup-dbera1b, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #119322 (Couple of random coroutine pass simplifications)
 - #119374 (Italicise "bytes" in the docs of some `Vec` methods)
 - #119388 (rustc_lint: Prevent triplication of various lints)
 - #119406 (Add non-regression test for ATPIT ICE #114325)
 - #119410 (Rename test to be more descriptive)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-12-30 01:44:41 +00:00
Matthias Krüger
bfc1643071
Rollup merge of #119410 - est31:fix_if_guard_unused, r=Nilstrieb
Rename test to be more descriptive

As suggested in https://github.com/rust-lang/rust/pull/119402#discussion_r1438171079

r? ``@Nilstrieb``
2023-12-29 21:40:24 +01:00
Matthias Krüger
7c5c948f2e
Rollup merge of #119406 - lqd:issue-114325, r=compiler-errors
Add non-regression test for ATPIT ICE #114325

ATPIT issue #114325 had been unknowingly fixed by https://github.com/rust-lang/rust/pull/107421, so this PR adds its [MCVE](https://github.com/rust-lang/rust/issues/114325#issuecomment-1721561552) as a non-regression test.

Closes #114325.
2023-12-29 21:40:23 +01:00
Matthias Krüger
c8d42740c5
Rollup merge of #119388 - Enselic:prevent-lint-triplication, r=cjgillot
rustc_lint: Prevent triplication of various lints

Prevent triplication of various lints. The triplication happens because we run the same lint three times (or less in some cases):
* In `BuiltinCombinedPreExpansionLintPass`
* In `BuiltinCombinedEarlyLintPass`
* In `shallow_lint_levels_on()`

Only run the lints one time by checking the `lint_added_lints` bool.

Set your GitHub diff setting to ignore whitespaces changes when reviewing this PR, since I had to enclose a block inside an if.

Closes #73301

(I found this while exploring the code related to [this](https://github.com/rust-lang/rust/pull/119251#discussion_r1435677330) comment.)
2023-12-29 21:40:23 +01:00
Matthias Krüger
ef55e757b3
Rollup merge of #119374 - gurry:119149-improve-vec-docs, r=cuviper
Italicise "bytes" in the docs of some `Vec` methods

On a cursory read it's easy to miss that the limit is in terms of bytes not no. of elements. The italics should help with that.

Fixes #119149
2023-12-29 21:40:22 +01:00
Matthias Krüger
b75ba15062
Rollup merge of #119322 - compiler-errors:async-gen-resume-ty, r=cjgillot
Couple of random coroutine pass simplifications

Just aesthetic changes, except for a random `Ty::new_task_context(tcx)` call that was redundant.
2023-12-29 21:40:22 +01:00
bors
3cdd004e55 Auto merge of #118911 - Young-Flash:fix_issue_118819, r=fmease
fix: correct the args for `disambiguate the associated function` diagnostic

This is somehow silimar to https://github.com/rust-lang/rust/pull/118502, we shouldn't take receiver as first arg all the cases.

close https://github.com/rust-lang/rust/issues/118819
2023-12-29 18:39:23 +00:00
bors
29abb90bbf Auto merge of #119373 - Kobzol:missing-tools-bootstrap, r=onur-ozkan
Remove usage of deprecated `missing-tools` bootstrap flag

This PR removes the usage of `--enable-missing-tools` in CI, as this config option is no longer used. It also removes `dist.missing-tools` config completely.

Let me know which commits should I remove (if any).

Fixes: https://github.com/rust-lang/rust/issues/79249

r? `@onur-ozkan`
2023-12-29 16:35:36 +00:00
bors
dc450f9dcb Auto merge of #119259 - cjgillot:single-crate-id, r=Mark-Simulacrum
Only store StableCrateId once in DefPathTable.

https://github.com/rust-lang/rust/pull/119238 made me think of this.

cc `@Mark-Simulacrum`
2023-12-29 14:37:40 +00:00
est31
740378cdde Rename test 2023-12-29 13:49:23 +01:00
bors
1a7e97f1ef Auto merge of #119387 - flip1995:clippy-subtree-sync, r=matthiaskrgr
Clippy subtree update

r? `@Manishearth`
2023-12-29 12:39:43 +00:00
bors
b74f5c4e8b Auto merge of #119407 - matthiaskrgr:rollup-bsoz7bn, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #119375 (Merge Coroutine lowering functions)
 - #119393 (Use filter instead of filter_map in Parser::expected_one_of_not_found)
 - #119401 (coverage: Avoid a possible query stability hazard in `CoverageCounters`)
 - #119402 (Also walk bindings created by if-let guards)
 - #119404 (Enable profiler in dist-powerpc-linux)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-12-29 10:41:45 +00:00
Matthias Krüger
761e0589c2
Rollup merge of #119404 - ecnelises:ppc_profiler, r=Kobzol
Enable profiler in dist-powerpc-linux
2023-12-29 11:19:29 +01:00
Matthias Krüger
efd9fd66ba
Rollup merge of #119402 - est31:fix_if_guard_unused, r=compiler-errors
Also walk bindings created by if-let guards

This change makes the `unused_variables` lint pick up unused bindings created by if-let guards.

Fixes #119383
2023-12-29 11:19:28 +01:00
Matthias Krüger
4b9a76cddf
Rollup merge of #119401 - Zalathar:query-stability, r=Nilstrieb
coverage: Avoid a possible query stability hazard in `CoverageCounters`

#119252 revealed a possible query stability hazard in `CoverageCounters`: we iterate over the entries of an `FxHashMap` in a way that allows the iteration order to potentially affect the relative creation order of MIR blocks.

I'm not sure whether there's an actual stability problem or not in practice, but it's certainly a hazard, and I don't see any reason not to switch over to `FxIndexMap` to avoid potential issues.

---

This can either be merged on its own, or incorporated into #119252.

cc `@Enselic`
r? `@cjgillot`
2023-12-29 11:19:28 +01:00
Matthias Krüger
12ad777221
Rollup merge of #119393 - DaniPopes:unmap-a-filter, r=Nilstrieb
Use filter instead of filter_map in Parser::expected_one_of_not_found
2023-12-29 11:19:27 +01:00
Matthias Krüger
559c864904
Rollup merge of #119375 - Swatinem:merge-coroutine-lowering, r=compiler-errors
Merge Coroutine lowering functions

Instead of having separate `make_async/etc_expr` functions, this merges them them into one, reducing code duplication a bit.
2023-12-29 11:19:27 +01:00
Rémy Rakic
21e8710ed3 add non-regression test for issue 114325 2023-12-29 10:01:53 +00:00
Qiu Chaofan
f7ed423f50 Enable profiler in dist-powerpc-linux 2023-12-29 16:50:24 +08:00
Gurinder Singh
e3aca01343 Italicise "bytes" in the docs of some Vec methods
because on a cursory read it's easy to miss that the limit is
in terms of bytes not no. of elements. The italics should help
with that.
2023-12-29 09:53:29 +05:30
bors
95613d1b23 Auto merge of #119392 - compiler-errors:args-parts, r=Nilstrieb
make `ClosureArgsParts` and `CoroutineArgsParts` not generic

I hope a few extra calls to `expect_ty` will not affect perf...
2023-12-29 04:21:41 +00:00
est31
ab60a7df64 Also walk bindings created by if-let guards 2023-12-29 03:38:09 +01:00
bors
dfb1f5e37b Auto merge of #119395 - Nilstrieb:walk-pat, r=est31
Use `Pat::walk_always` instead of manual walk

It's also a bit faster, but I doubt that it will have a noticeable perf impact. Mostly doing it because it's shorter and nicer.
2023-12-29 02:03:10 +00:00
Zalathar
8529b63e2b coverage: Avoid a possible query stability hazard in CoverageCounters
The iteration order of this hashmap can potentially affect the relative
creation order of MIR blocks.
2023-12-29 12:33:52 +11:00
Michael Goulet
d71f7be218 Couple of random coroutine pass simplifications 2023-12-29 00:19:33 +00:00
bors
63623043f7 Auto merge of #119378 - onur-ozkan:utilize-llvm-tools, r=albertlarsan68
utilize the unused `llvm-tools` option

This field was not functioning as described in its comment in `config.example.toml`. Also, updated the default value to `true` to keep the bootstrapping behavior as it was before.

cc `@Zalathar`
2023-12-29 00:04:34 +00:00
Nilstrieb
8fe4d0d156 Use Pat::walk_always instead of manual walk 2023-12-28 23:21:55 +01:00
bors
fb5ed726f7 Auto merge of #119174 - compiler-errors:movability, r=cjgillot
Remove movability from `TyKind::Coroutine`

There's no reason to store movability in the generator struct directly. It is computed from the HIR, and can be pulled into a query to access when necessary.
2023-12-28 20:41:44 +00:00
Arpad Borsos
2480a0f3f6
Merge Coroutine lowering functions
Instead of having separate `make_async/etc_expr` functions, this merges them them into one, reducing code duplication a bit.
2023-12-28 21:24:24 +01:00
DaniPopes
c7a67747d3
Use filter instead of filter_map in Parser::expected_one_of_not_found 2023-12-28 21:19:41 +01:00
Michael Goulet
2b69399fea make ClosureArgsParts not generic 2023-12-28 20:17:09 +00:00
Jakub Beránek
fdeb8c5027
Remove is_optional_tool from ToolBuild 2023-12-28 20:23:16 +01:00
Jakub Beránek
0e7f9ec2ca
Add change tracker entry 2023-12-28 20:23:12 +01:00
Martin Nordholts
7ca4e9fcb2 rustc_lint: Prevent triplication of 'unknown lint' lint 2023-12-28 19:46:51 +01:00
Martin Nordholts
741884dab2 rustc_lint: Prevent multiple 'incompatible with previous forbid' lints 2023-12-28 19:46:40 +01:00
Martin Nordholts
e0c626fbbc rustc_lint: Prevent multiple 'lint ignored' lints
Prevent multiple 'ignored unless specified at crate level' lints. The
multiplication happens because we run the same lint three times:
* In BuiltinCombinedEarlyLintPass
* In BuiltinCombinedPreExpansionLintPass
* In shallow_lint_levels_on

Only run the lint one time by checking the `lint_added_lints` bool.
2023-12-28 19:46:40 +01:00
Martin Nordholts
eef02c453f rustc_lint: Rename warn_about_weird_lints to lint_added_lints
So we can apply more kinds of lints to added lints without having to add
another parameter.
2023-12-28 19:46:40 +01:00
Martin Nordholts
a4bcd479cc rustc_error_codes: Update expected error in E0453.md 2023-12-28 19:46:40 +01:00
Philipp Krones
0217ac9da6
Update Cargo.lock 2023-12-28 19:33:21 +01:00
Philipp Krones
379b00ab77
Merge commit 'ac4c2094a6030530661bee3876e0228ddfeb6b8b' into clippy-subtree-sync 2023-12-28 19:33:07 +01:00
bors
ac4c2094a6 Auto merge of #12038 - flip1995:rustup, r=flip1995
Rustup

r? `@ghost`

changelog: none
2023-12-28 18:25:36 +00:00
Philipp Krones
2a4c7d2b0f
Bump Clippy version -> 0.1.77 2023-12-28 19:21:01 +01:00
Philipp Krones
887278c40a
Bump nightly version -> 2023-12-28 2023-12-28 19:20:40 +01:00
Philipp Krones
9ff84af787
Merge remote-tracking branch 'upstream/master' into rustup 2023-12-28 19:20:18 +01:00
bors
3ee6710954 Auto merge of #119384 - matthiaskrgr:rollup-hhz9ws0, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #119331 (rustdoc-search: count path edits with separate edit limit)
 - #119359 (Simplify Parser::ident_or_error)
 - #119376 (Add regression test for #106630)
 - #119379 (Update `parse_seq` doc)
 - #119380 (Don't suggest writing a bodyless arm if the pattern can never be a never pattern)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-12-28 17:54:35 +00:00
Matthias Krüger
e8831b6df8
Rollup merge of #119380 - ShE3py:match-never-pat, r=petrochenkov
Don't suggest writing a bodyless arm if the pattern can never be a never pattern

#118527 enabled arms to be bodyless for never patterns ; this PR removes the `,` and `}` suggestions for patterns that could never be never patterns.
2023-12-28 18:48:02 +01:00
Matthias Krüger
0b6e8f5324
Rollup merge of #119379 - ShE3py:parse-seq-doc, r=compiler-errors
Update `parse_seq` doc

Some doc changes I made while working on an issue.
2023-12-28 18:48:01 +01:00
Matthias Krüger
77c23b3e94
Rollup merge of #119376 - msrd0:regression-test-106630, r=petrochenkov
Add regression test for #106630

This PR adds a regression test for #106630. I was unsure where exactly to place the test or how to test it locally so please let me know if I should change something.
2023-12-28 18:48:01 +01:00
Matthias Krüger
54bcb07ab1
Rollup merge of #119359 - DaniPopes:ident-or-err, r=compiler-errors
Simplify Parser::ident_or_error

Avoid a nested `Result<T, PResult<T>>`.
2023-12-28 18:48:01 +01:00
Matthias Krüger
2f51bad66b
Rollup merge of #119331 - notriddle:notriddle/maxpatheditdistance, r=GuillaumeGomez
rustdoc-search: count path edits with separate edit limit

Avoids strange-looking results like this one, where the path component seems to be ignored:

![image](https://github.com/rust-lang/rust/assets/1593513/f0ef077a-6e09-4d67-a29d-8cabc1495f66)

Since the two are counted separately elsewhere, they should get their own limits, too. The biggest problem with combining them is that paths are loosely checked by not requiring every component to match, which means that if they are short and matched loosely, they can easily find "drunk typist" matches that make no sense, like this old result:

    std::collections::btree_map::itermut matching slice::itermut
    maxEditDistance = ("slice::itermut".length) / 3 = 14 / 3 = 4
    editDistance("std", "slice") = 4
    editDistance("itermut", "itermut") = 0
        4 + 0 <= 4 PASS

Of course, `slice::itermut` should not match stuff from btreemap. `slice` should not match `std`.

The new result counts them separately:

    maxPathEditDistance = "slice".length / 3 = 5 / 3 = 1
    maxEditDistance = "itermut".length / 3 = 7 / 3 = 2
    editDistance("std", "slice") = 4
        4 <= 1 FAIL

Effectively, this makes path queries less "typo-resistant". It's not zero, but it means `vec` won't match the `v1` prelude.

This commit also adds substring matching to paths. It's stricter than the substring matching in the main part, but loose enough that what I expect to match does.

Queries without parent paths are unchanged.
2023-12-28 18:48:00 +01:00