Skip to content
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

Rollup of 7 pull requests #109517

Merged
merged 21 commits into from
Mar 23, 2023
Merged

Rollup of 7 pull requests #109517

merged 21 commits into from
Mar 23, 2023

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

petrochenkov and others added 21 commits March 16, 2023 17:22
This is a cleanup that doesn't introduce new query calls, but this way `def_key` is decoded twice which may matter for performance or may not
Includes resolving the FIXMEs in the documentation,
and some very minor documentation improvements.
…r=oli-obk

Suppress `opaque_hidden_inferred_bound` for nested RPITs

They trigger too much, making repos like linkerd/linkerd2-proxy#2275 sad.

Ideally, at least for RPITs (and probably TAITs?), specifically when we have `impl Trait<Assoc = impl ..>`, that nested opaque should have the necessary `Assoc` item bounds elaborated into its own item bounds. But that's another story.

r? ```@oli-obk```
resolve: Querify most cstore access methods (subset 2)

These changes are less likely to cause perf regressions than the rest of rust-lang#108346.
add `known-bug` test for unsoundness issue

Test for rust-lang#97156
…xyUwU,lcnr

Make alias-eq have a relation direction (and rename it to alias-relate)

Emitting an "alias-eq" is too strict in some situations, since we don't always want strict equality between a projection and rigid ty. Adds a relation direction.

* I could probably just reuse this [`RelationDir`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/combine/enum.RelationDir.html) -- happy to uplift that struct into middle and use that instead, but I didn't feel compelled to... 🤷
* Some of the matching in `compute_alias_relate_goal` is a bit verbose -- I guess I could simplify it by using [`At::relate`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/at/struct.At.html#method.relate) and mapping the relation-dir to a variance.
* Alternatively, I coulld simplify things by making more helper functions on `EvalCtxt` (e.g. `EvalCtxt::relate_with_direction(T, T)` that also does the nested goal registration). No preference.

r? ```@lcnr``` cc ```@BoxyUwU``` though boxy can claim it if she wants
NOTE: first commit is all the changes, the second is just renaming stuff
…apkin

Simpler checked shifts in MIR building

Doing masking to check unsigned shift amounts is overcomplicated; just comparing the shift directly saves a statement and a temporary, as well as is much easier to read as a human.  And shifting by unsigned is the canonical case -- notably, all the library shifting methods (that don't support every type) take shift RHSs as `u32` -- so we might as well make that simpler since it's easy to do so.

This PR also changes *signed* shift amounts to `IntToInt` casts and then uses the same check as for unsigned.  The bit-masking is a nice trick, but for example LLVM actually canonicalizes it to an unsigned comparison anyway <https://rust.godbolt.org/z/8h59fMGT4> so I don't think it's worth the effort and the extra `Constant`.  (If MIR's `assert` was `assert_nz` then the masking might make sense, but when the `!=` uses another statement I think the comparison is better.)

To review, I suggest looking at rust-lang@2ee0468 first -- that's the interesting code change and has a MIR diff.

My favourite part of the diff:
```diff
-        _20 = BitAnd(_19, const 340282366920938463463374607431768211448_u128); // scope 0 at $DIR/shifts.rs:+2:34: +2:44
-        _21 = Ne(move _20, const 0_u128); // scope 0 at $DIR/shifts.rs:+2:34: +2:44
-        assert(!move _21, "attempt to shift right by `{}`, which would overflow", _19) -> [success: bb3, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+2:34: +2:44
+        _18 = Lt(_17, const 8_u128);     // scope 0 at $DIR/shifts.rs:+2:34: +2:44
+        assert(move _18, "attempt to shift right by `{}`, which would overflow", _17) -> [success: bb3, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+2:34: +2:44
```
…, r=joshtriplett

Stabilize `arc_into_inner` and `rc_into_inner`.

Stabilize the `arc_into_inner` and `rc_into_inner` library features and thus close rust-lang#106894.

The changes in this PR also resolve the FIXMEs for adjusting the documentation upon stabilization, and I’ve additionally included some very minor documentation improvements.

```@rustbot``` label +T-libs-api -T-libs
…ng, r=compiler-errors

make param bound vars visibly bound vars with -Zverbose

I was trying to debug some type/const bound var stuff and it was shockingly tricky due to the fact that even with `-Zverbose` enabled the `T` in `for<T> T: Trait` prints as `T` making it seem like its `TyKind::Param` when it is infact `TyKind::Bound`. This PR "fixes" this when `-Zverbose` is set to allow rendering it as `^T` or `^1_T` depending on binder depth.

r? ```@compiler-errors```
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative rollup A PR which is a rollup labels Mar 23, 2023
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=7

@bors
Copy link
Contributor

bors commented Mar 23, 2023

📌 Commit 477ce58 has been approved by matthiaskrgr

It is now in the queue for this repository.

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 23, 2023
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Mar 23, 2023
@bors
Copy link
Contributor

bors commented Mar 23, 2023

⌛ Testing commit 477ce58 with merge 5bf63a243b61a57222b1ca12225e21e9e2ce46b0...

@bors
Copy link
Contributor

bors commented Mar 23, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 23, 2023
@matthiaskrgr
Copy link
Member Author

@bors retry

@bors 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 Mar 23, 2023
@rust-log-analyzer
Copy link
Collaborator

The job dist-x86_64-mingw failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[260/3025] Building CXX object lib/BinaryFormat/CMakeFiles/LLVMBinaryFormat.dir/Wasm.cpp.obj
[261/3025] Building CXX object lib/BinaryFormat/CMakeFiles/LLVMBinaryFormat.dir/MsgPackReader.cpp.obj
[262/3025] Building CXX object lib/Extensions/CMakeFiles/LLVMExtensions.dir/Extensions.cpp.obj
[263/3025] Linking CXX static library lib\libLLVMBinaryFormat.a
FAILED: lib/libLLVMBinaryFormat.a 
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E rm -f lib\libLLVMBinaryFormat.a && C:\a\rust\rust\mingw64\bin\ar.exe qc lib\libLLVMBinaryFormat.a  lib/BinaryFormat/CMakeFiles/LLVMBinaryFormat.dir/AMDGPUMetadataVerifier.cpp.obj lib/BinaryFormat/CMakeFiles/LLVMBinaryFormat.dir/COFF.cpp.obj lib/BinaryFormat/CMakeFiles/LLVMBinaryFormat.dir/Dwarf.cpp.obj lib/BinaryFormat/CMakeFiles/LLVMBinaryFormat.dir/ELF.cpp.obj lib/BinaryFormat/CMakeFiles/LLVMBinaryFormat.dir/MachO.cpp.obj lib/BinaryFormat/CMakeFiles/LLVMBinaryFormat.dir/Magic.cpp.obj lib/BinaryFormat/CMakeFiles/LLVMBinaryFormat.dir/Minidump.cpp.obj lib/BinaryFormat/CMakeFiles/LLVMBinaryFormat.dir/MsgPackDocument.cpp.obj lib/BinaryFormat/CMakeFiles/LLVMBinaryFormat.dir/MsgPackDocumentYAML.cpp.obj lib/BinaryFormat/CMakeFiles/LLVMBinaryFormat.dir/MsgPackReader.cpp.obj lib/BinaryFormat/CMakeFiles/LLVMBinaryFormat.dir/MsgPackWriter.cpp.obj lib/BinaryFormat/CMakeFiles/LLVMBinaryFormat.dir/Wasm.cpp.obj lib/BinaryFormat/CMakeFiles/LLVMBinaryFormat.dir/XCOFF.cpp.obj && C:\a\rust\rust\mingw64\bin\ranlib.exe lib\libLLVMBinaryFormat.a && cd ."
C:\a\rust\rust\mingw64\bin\ranlib.exe: could not create temporary file whilst writing archive: no more archived files
[264/3025] Linking CXX static library lib\libLLVMExtensions.a
[265/3025] Building CXX object lib/MC/CMakeFiles/LLVMMC.dir/MCAsmBackend.cpp.obj
[266/3025] Building CXX object lib/MC/CMakeFiles/LLVMMC.dir/ConstantPools.cpp.obj
[267/3025] Building CXX object lib/MC/CMakeFiles/LLVMMC.dir/MCAsmInfoCOFF.cpp.obj
[267/3025] Building CXX object lib/MC/CMakeFiles/LLVMMC.dir/MCAsmInfoCOFF.cpp.obj
[268/3025] Building CXX object lib/MC/CMakeFiles/LLVMMC.dir/ELFObjectWriter.cpp.obj
[269/3025] Building CXX object lib/MC/CMakeFiles/LLVMMC.dir/MCAsmInfoDarwin.cpp.obj
[270/3025] Linking CXX executable bin\llvm-tblgen.exe
ninja: build stopped: subcommand failed.
command did not execute successfully, got: exit code: 1


build script failed, must exit now', C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cmake-0.1.48\src\lib.rs:975:5
 finished in 46.581 seconds
Build completed unsuccessfully in 0:03:36

@bors
Copy link
Contributor

bors commented Mar 23, 2023

⌛ Testing commit 477ce58 with merge 99c49d9...

@bors
Copy link
Contributor

bors commented Mar 23, 2023

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 99c49d9 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 23, 2023
@bors bors merged commit 99c49d9 into rust-lang:master Mar 23, 2023
@rustbot rustbot added this to the 1.70.0 milestone Mar 23, 2023
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Perf Build Sha
#109506 39380d79b03c2b961584732eba9445dffd8d7d00
#109504 3558f8a520a63b2cbdbf443738518348d0e966a9
#109475 f5b1466cfad0645a0f75ecd3fa5dd1ee36f39d46
#109462 3e150e35f0c84da5c28c5cf1672dbd011d0239b7
#109380 97bd4eec8a93f6124e8d0658cf70aae0fd52fb56
#109137 3da1bb254cbecfae74adb541b3d99599dfc36c91
#108541 a5f526f0a47a0e3c1167d13ebd86afa782f3b54d

previous master: 9a6b0c3326

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (99c49d9): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.4% [-0.4%, -0.4%] 1
Improvements ✅
(secondary)
-0.5% [-0.7%, -0.4%] 6
All ❌✅ (primary) -0.4% [-0.4%, -0.4%] 1

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.7% [0.4%, 3.5%] 3
Improvements ✅
(primary)
-1.3% [-1.3%, -1.3%] 1
Improvements ✅
(secondary)
-1.1% [-2.2%, -0.6%] 6
All ❌✅ (primary) -1.3% [-1.3%, -1.3%] 1

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.7% [-1.2%, -0.5%] 5
All ❌✅ (primary) - - 0

flip1995 pushed a commit to flip1995/rust that referenced this pull request Mar 24, 2023
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#108541 (Suppress `opaque_hidden_inferred_bound` for nested RPITs)
 - rust-lang#109137 (resolve: Querify most cstore access methods (subset 2))
 - rust-lang#109380 (add `known-bug` test for unsoundness issue)
 - rust-lang#109462 (Make alias-eq have a relation direction (and rename it to alias-relate))
 - rust-lang#109475 (Simpler checked shifts in MIR building)
 - rust-lang#109504 (Stabilize `arc_into_inner` and `rc_into_inner`.)
 - rust-lang#109506 (make param bound vars visibly bound vars with -Zverbose)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@matthiaskrgr matthiaskrgr deleted the rollup-m3orqzd branch March 16, 2024 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative
Projects
None yet
Development

Successfully merging this pull request may close these issues.