bors [Sun, 22 Jan 2023 06:53:36 +0000 (06:53 +0000)]
Auto merge of #107185 - compiler-errors:rollup-wkomjma, r=compiler-errors
Rollup of 8 pull requests
Successful merges:
- #103418 (Add `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` to future-incompat report)
- #106113 (llvm-wrapper: adapt for LLVM API change)
- #106144 (Improve the documentation of `black_box`)
- #106578 (Label closure captures/generator locals that make opaque types recursive)
- #106749 (Update cc to 1.0.77)
- #106935 (Fix `SingleUseLifetime` ICE)
- #107015 (Re-enable building rust-analyzer on riscv64)
- #107029 (Add new bootstrap members to triagebot.toml)
Michael Goulet [Sun, 22 Jan 2023 04:21:02 +0000 (23:21 -0500)]
Rollup merge of #107029 - albertlarsan68:patch-2, r=Mark-Simulacrum
Add new bootstrap members to triagebot.toml
```@ozkanonur``` if you want to be assigned to review PRs too, just post a message to this thread.
Should a `T-bootstrap` label be created, since `src/tools/tidy` is assigned to the `bootstrap` members, but labeled `A-testsuite` (and not `A-bootstrap`) ?
Michael Goulet [Sun, 22 Jan 2023 04:20:58 +0000 (23:20 -0500)]
Rollup merge of #106113 - krasimirgg:llvm-16-ext-tyid, r=nikic
llvm-wrapper: adapt for LLVM API change
No functional changes intended.
The LLVM commit https://github.com/llvm/llvm-project/commit/e6b02214c68df2c9f826e02310c9352ac652e456 added `TargetExtTyID` to the `TypeID` enum. This adapts `RustWrapper` accordingly.
Michael Goulet [Sun, 22 Jan 2023 04:20:58 +0000 (23:20 -0500)]
Rollup merge of #103418 - Aaron1011:macro-semicolon-future-incompat, r=davidtwco
Add `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` to future-incompat report
See https://github.com/rust-lang/rust/issues/79813 for a discussion of this lint. This has been warn-by-default for over a year, so adding it to the future-incompat report should help to find libraries that haven't yet updated.
bors [Sat, 21 Jan 2023 17:44:20 +0000 (17:44 +0000)]
Auto merge of #105924 - TimNN:ui-remap, r=Mark-Simulacrum
Remap paths in UI tests by default
If you think this needs further discussions / something RFC-like, please let me know the best forum for that.
This PR runs UI tests with a remapped "src base" directory by default.
Why? Because some UI tests currently depend on the length of the absolute path to the `src/test/ui` directory. Remapping makes the tests independent of the absolute path.
The path to the source file (which is absolute on CI) is part of the type name of closures. `rustc` diagnostic output depends on the length of type names (long type names are truncated). So a long absolute path leads to long closure type names, which leads to truncation and changed diagnostics.
(I initially tried just disabling type name truncation, but that made some error messages stupid long (thousands of characters, IIRC)).
Additional changes:
* All boolean `compiletest` directives now support explicit `no-` versions to disable them.
* Adapt existing tests when necessary:
* Disable remapping for individual tests that fail with it enabled (when there's no obvious alternative fix).
* For tests that already check something remapping related switch to the new option unless we gain something significant by keeping the manual remap.
Passed Windows CI in https://github.com/rust-lang/rust/actions/runs/3933100590
bors [Sat, 21 Jan 2023 14:18:17 +0000 (14:18 +0000)]
Auto merge of #106977 - michaelwoerister:unord_id_collections, r=oli-obk
Use UnordMap and UnordSet for id collections (DefIdMap, LocalDefIdMap, etc)
This PR changes the `rustc_data_structures::define_id_collections!` macro to use `UnordMap` and `UnordSet` instead of `FxHashMap` and `FxHashSet`. This should account for a large portion of hash-maps being used in places where they can cause trouble.
The changes required are moderate but non-zero:
- In some places the collections are extracted into sorted vecs.
- There are a few instances where for-loops have been changed to extends.
~~Let's see what the performance impact is. With a bit more refactoring, we might be able to get rid of some of the additional sorting -- but the change set is already big enough. Unless there's a performance impact, I'd like to do further changes in subsequent PRs.~~
Performance does not seem to be negatively affected ([perf-run here](https://github.com/rust-lang/rust/pull/106977#issuecomment-1396776699)).
Part of [MCP 533](https://github.com/rust-lang/compiler-team/issues/533).
bors [Sat, 21 Jan 2023 04:19:03 +0000 (04:19 +0000)]
Auto merge of #107143 - compiler-errors:rollup-zabvmo5, r=compiler-errors
Rollup of 9 pull requests
Successful merges:
- #104154 (Change `bindings_with_variant_name` to deny-by-default)
- #104347 (diagnostics: suggest changing `s@self::{macro}`@::macro`` for exported)
- #104672 (Unify stable and unstable sort implementations in same core module)
- #107048 (check for x version updates)
- #107061 (Implement some more new solver candidates and fix some bugs)
- #107095 (rustdoc: remove redundant CSS selector `.sidebar .current`)
- #107112 (Fix typo in opaque_types.rs)
- #107124 (fix check macro expansion)
- #107131 (rustdoc: use CSS inline layout for radio line instead of flexbox)
Michael Goulet [Sat, 21 Jan 2023 02:33:22 +0000 (21:33 -0500)]
Rollup merge of #107061 - compiler-errors:new-solver-new-candidates-3, r=lcnr
Implement some more new solver candidates and fix some bugs
First, fix some bugs:
1. `IndexVec::drain_enumerated(a..b)` does not give us an iterator of index keys + items enumerated from `a..b`, but from `0..(b-a)`... That caused a bug. See first commit for the fix.
2. Implement the `_: Trait` ambiguity hack. I put it in assemble, let me know if it should live elsewhere. This is important, since we otherwise consider `_: Sized` to have no solutions, and nothing passes!
3. Swap `Ambiguity` and `Unimplemented` cases for the new solver. Sorry for accidentally swapping them 😄
4. Check GATs' own predicates during projection confirmation.
Then implement a few builtin traits:
5. Implement `PointerSized`. Pretty independent.
6. Implement `Fn` family of traits for fnptr, fndef, and closures. Closures are currently broken because `FulfillCtxt::relationships` is intentionally left unimplemented. See comment in the test.
Michael Goulet [Sat, 21 Jan 2023 02:33:22 +0000 (21:33 -0500)]
Rollup merge of #107048 - DebugSteven:newer-x-check-cargo, r=albertlarsan68
check for x version updates
This PR adds a check to tidy to assert that the installed version of `x` is equal to the version in `src/tools/x/Cargo.toml`. It checks the installed version of `x` by parsing the output of `cargo install --list` (as an option proposed in this [issue](https://github.com/rust-lang/rust/issues/106469)).
It does not warn if `x` has not yet been installed, on the assumption that the user isn't interested in using it.
Michael Goulet [Sat, 21 Jan 2023 02:33:21 +0000 (21:33 -0500)]
Rollup merge of #104672 - Voultapher:unify-sort-modules, r=thomcc
Unify stable and unstable sort implementations in same core module
This moves the stable sort implementation to the core::slice::sort module. By virtue of being in core it can't access `Vec`. The two `Vec` used by merge sort, `buf` and `runs`, are modelled as custom types that implement the very limited required `Vec` interface with the help of provided allocation and free functions. This is done to allow future re-use of functions and logic between stable and unstable sort. Such as `insert_head`.
This is in preparation of #100856 and #104116. It only moves code, it *doesn't* change any of the sort related logic. This unlocks the ability to share `insert_head`, `insert_tail`, `swap_if_less` `merge` and more.
Tagging ````@Mark-Simulacrum```` I hope this allows progress on #100856, by moving `merge_sort` here I hope future changes will be easier to review.
bors [Sat, 21 Jan 2023 01:18:13 +0000 (01:18 +0000)]
Auto merge of #107139 - rust-lang:pa-bump-git2, r=Mark-Simulacrum
[master] Update git2 version
This PR bumps the version of the `git2` and `libgit2-sys` crates to pull in fixes for https://github.com/rust-lang/git2-rs/security/advisories/GHSA-m4ch-rfv5-x5g3.
This **does not fix any security vulnerability**: Cargo is already protected thanks to the fixes we implemented as part of CVE-2022-46176. The only purpose of this PR is to avoid dependency scanners from flagging vulnerabilities.
2023-01-19 10:09:05 +0000 to 2023-01-20 14:39:28 +0000
- Stabilize sparse-registry (rust-lang/cargo#11224)
- Wrapper type for data that should never be logged (rust-lang/cargo#11545)
- Add semver rule for lints (rust-lang/cargo#11596)
2023-01-19 10:09:05 +0000 to 2023-01-20 14:39:28 +0000
- Stabilize sparse-registry (rust-lang/cargo#11224)
- Wrapper type for data that should never be logged (rust-lang/cargo#11545)
- Add semver rule for lints (rust-lang/cargo#11596)
bors [Fri, 20 Jan 2023 12:58:13 +0000 (12:58 +0000)]
Auto merge of #107105 - matthiaskrgr:rollup-rkz9t7r, r=matthiaskrgr
Rollup of 8 pull requests
Successful merges:
- #106783 (Recover labels written as identifiers)
- #106973 (Don't treat closures from other crates as local)
- #106979 (Document how to get the type of a default associated type)
- #107053 (signal update string representation for haiku.)
- #107058 (Recognise double-equals homoglyph)
- #107067 (Custom MIR: Support storage statements)
- #107076 (Added const-generic ui test case for issue #106419)
- #107091 (Fix broken format strings in `infer.ftl`)
Matthias Krüger [Fri, 20 Jan 2023 06:25:29 +0000 (07:25 +0100)]
Rollup merge of #107065 - flip1995:clippyup, r=Manishearth
Clippy: Make sure to include in beta: Move `unchecked_duration_subtraction` to pedantic
This was merged one day too late in order to make it into the last sync. But since we talked about moving this lint to `pedantic` in the meeting, I'd like to get this in rather sooner than later.
Matthias Krüger [Fri, 20 Jan 2023 06:25:27 +0000 (07:25 +0100)]
Rollup merge of #106699 - eholk:await-chains-drop-tracking, r=wesleywiser
[drop tracking] Visit break expressions
This fixes https://github.com/rust-lang/rust/issues/102383 by remembering to visit the expression in `break expr` when building the drop tracking CFG. Missing this step was causing an off-by-one error which meant after a number of awaits we'd be
looking for dropped values at the wrong point in the code.
Additionally, this changes the order of traversal for assignment expressions to visit the rhs and then the lhs. This matches what is done elsewhere.
Finally, this improves some of the debugging output (for example, the CFG visualizer) to make it easier to figure out these sorts of issues.
Matthias Krüger [Fri, 20 Jan 2023 06:16:11 +0000 (07:16 +0100)]
Rollup merge of #107076 - megakorre:106419_add_test_case, r=compiler-errors
Added const-generic ui test case for issue #106419
This PR adds a test case for #106419 which has been fixed in master by #105292
I also ran the test on f769d34291e489db19d3c972348ddb24b6b32481 (the commit before #105292 was merged)
and it did fail there with the following output.
```
--- stderr -------------------------------
error[E0308]: mismatched types
--> /home/patrikk/src/rust/src/test/ui/const-generics/issue-106419-struct-with-multiple-const-params.rs:5:10
|
LL | #[derive(Clone)]
| ^^^^^
| |
| expected `A`, found `B`
| expected `Bar<A, B>` because of return type
|
= note: expected struct `Bar<A, _>`
found struct `Bar<B, _>`
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
------------------------------------------
```
Matthias Krüger [Fri, 20 Jan 2023 06:16:09 +0000 (07:16 +0100)]
Rollup merge of #106973 - oli-obk:tait_ice_closure_in_impl_header, r=lcnr
Don't treat closures from other crates as local
fixes #104817
r? `@lcnr`
Specialization can prefer an impl for an opaque type over a blanket impls that also matches. If the blanket impl only applies if an auto-trait applies, we look at the hidden type of the opaque type to see if that implements the auto trait. The hidden type can be a closure or generator, and thus we will end up seeing these types in coherence and have to handle them properly.
bors [Fri, 20 Jan 2023 01:55:36 +0000 (01:55 +0000)]
Auto merge of #107083 - GuillaumeGomez:revert-104889, r=notriddle
rustdoc: Revert #104889
Reverts #104889.
I don't think I'll be able to finish https://github.com/rust-lang/rust/pull/107000 on time unfortunately so to prevent https://github.com/rust-lang/rust/issues/106373, better to revert it and to make it into the next release.
- Normalize git deps when doing `cargo vendor` for resolving deps inherited from a workspace (rust-lang/cargo#11414)
- Ignore `workspace.default-members` when running `cargo install` on root package of a non-virtual workspace (rust-lang/cargo#11067)
- Corrected documentation of how to cache binaries installed with `cargo install` in CI workflows (rust-lang/cargo#11592)
bors [Thu, 19 Jan 2023 16:49:06 +0000 (16:49 +0000)]
Auto merge of #107038 - compiler-errors:dont-wfcheck-non-local-rpit, r=oli-obk
Don't wf-check non-local RPITs
We were using `ty::is_impl_trait_defn(..).is_none()` to check if we need to add WF obligations for an opaque type.
This is *supposed* to be checking if the type is a TAIT, since RPITs' wfness is implied by wf checking its parent item, but since `is_impl_trait_defn` returns `None` for non-local RPIT and async futures, we unnecessarily consider wf predicates for an RPIT if it is coming from a foreign crate.
- Normalize git deps when doing `cargo vendor` for resolving deps inherited from a workspace (rust-lang/cargo#11414)
- Ignore `workspace.default-members` when running `cargo install` on root package of a non-virtual workspace (rust-lang/cargo#11067)
- Corrected documentation of how to cache binaries installed with `cargo install` in CI workflows (rust-lang/cargo#11592)
bors [Thu, 19 Jan 2023 11:12:31 +0000 (11:12 +0000)]
Auto merge of #107064 - GuillaumeGomez:rollup-pbgu6r3, r=GuillaumeGomez
Rollup of 5 pull requests
Successful merges:
- #105977 (Transform async `ResumeTy` in generator transform)
- #106927 (make `CastError::NeedsDeref` create a `MachineApplicable` suggestion)
- #106931 (document + UI test `E0208` and make its output more user-friendly)
- #107027 (Remove extra removal from test path)
- #107037 (Fix Dominators::rank_partial_cmp to match documentation)
Guillaume Gomez [Thu, 19 Jan 2023 10:19:36 +0000 (11:19 +0100)]
Rollup merge of #107027 - GuillaumeGomez:rm-extra-removal, r=tmiasko
Remove extra removal from test path
I don't know how to describe it shortly so better show what it's doing instead. Currently, there is one extra "rust/" before the test folder when running tests:
This is a bit annoying when copying the test path. This is due to the moving of the `tests` folder one level up, meaning we were trimming too much of the `root_path`.
Guillaume Gomez [Thu, 19 Jan 2023 10:19:35 +0000 (11:19 +0100)]
Rollup merge of #106931 - Ezrashaw:docs-e0208, r=compiler-errors
document + UI test `E0208` and make its output more user-friendly
Cleans up `E0208`'s output a lot. It could actually be useful for someone learning about variance now. I also added a UI test for it in `tests/ui/error-codes/` and wrote some docs for it.
r? `@GuillaumeGomez` another error code, can't be bothered to find the issue :P. Obviously there's some compiler stuff, so you'll have to hand it off.
Part of https://github.com/rust-lang/rust/issues/61137.