Skip to content

Avoid invoking typeck from borrowck #108487

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

Merged
merged 4 commits into from
Feb 28, 2023
Merged

Conversation

cjgillot
Copy link
Contributor

This PR attempts to reduce direct dependencies between typeck and MIR-related queries. The goal is to have all the information transit either through THIR or through dedicated queries that avoid depending on the whole TypeckResults.

In a first commit, we store the type information that MIR building requires into THIR. This avoids edges between mir_built and typeck.

In the second and third commit, we wrap informations around closures (upvars, kind origin and user-provided signature) to avoid borrowck depending on typeck information.

There should be a single remaining borrowck -> typeck edge in the good path, due to inline consts.

@rustbot
Copy link
Collaborator

rustbot commented Feb 26, 2023

r? @oli-obk

(rustbot has picked a reviewer for you, use r? to override)

@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. labels Feb 26, 2023
@rustbot
Copy link
Collaborator

rustbot commented Feb 26, 2023

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

@oli-obk
Copy link
Contributor

oli-obk commented Feb 26, 2023

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 26, 2023
@bors
Copy link
Collaborator

bors commented Feb 26, 2023

⌛ Trying commit cb51d2d with merge 18882814f30287397b64afc4ee2f1368646ac69c...

@bors
Copy link
Collaborator

bors commented Feb 26, 2023

☀️ Try build successful - checks-actions
Build commit: 18882814f30287397b64afc4ee2f1368646ac69c (18882814f30287397b64afc4ee2f1368646ac69c)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (18882814f30287397b64afc4ee2f1368646ac69c): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -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
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.2%] 3
All ❌✅ (primary) - - 0

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)
- - 0
Improvements ✅
(primary)
-1.0% [-1.0%, -1.0%] 1
Improvements ✅
(secondary)
-3.8% [-3.9%, -3.6%] 3
All ❌✅ (primary) -1.0% [-1.0%, -1.0%] 1

Cycles

This benchmark run did not return any relevant results for this metric.

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 26, 2023
@oli-obk
Copy link
Contributor

oli-obk commented Feb 26, 2023

@bors r+

@bors
Copy link
Collaborator

bors commented Feb 26, 2023

📌 Commit cb51d2d has been approved by oli-obk

It is now in the queue for this repository.

@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 Feb 26, 2023
@bors
Copy link
Collaborator

bors commented Feb 27, 2023

⌛ Testing commit cb51d2d with merge e0cecf0b598e94bb0ab94315ffc2fc7bb598d866...

@bors
Copy link
Collaborator

bors commented Feb 27, 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 Feb 27, 2023
@cjgillot
Copy link
Contributor Author

@bors retry spurious network error

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 27, 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 Feb 27, 2023
@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
      System Firmware Version: VMW71.00V.13989454.B64.1906190538
      OS Loader Version: 540.120.3~22
      Apple ROM Info: [MS_VM_CERT/SHA1/27d66596a61c48dd3dc7216fd715126e33f59ae7]Welcome to the Virtual Machine
      SMC Version (system): 2.8f0
      Serial Number (system): VMmTmlrsGJlu
      Provisioning UDID: 4203018E-580F-C1B5-9525-B745CECA79EB

hw.ncpu: 3
hw.byteorder: 1234
---
    Finished release [optimized] target(s) in 3m 51s
[TIMING] tool::Rustdoc { compiler: Compiler { stage: 2, host: aarch64-apple-darwin } } -- 231.728
Building tool rust-analyzer-proc-macro-srv (stage1:x86_64-apple-darwin -> stage1:aarch64-apple-darwin)
    Updating crates.io index
warning: spurious network error (2 tries remaining): failed to get successful HTTP response from `https://index.crates.io/ro/wa/rowan`, got 503


warning: spurious network error (1 tries remaining): failed to get successful HTTP response from `https://index.crates.io/ro/wa/rowan`, got 503


error: failed to get `rowan` as a dependency of package `syntax v0.0.0 (/Users/runner/work/rust/rust/src/tools/rust-analyzer/crates/syntax)`
Caused by:
  failed to query replaced source registry `crates-io`

Caused by:
Caused by:
  download of ro/wa/rowan failed
Caused by:
Caused by:
  failed to get successful HTTP response from `https://index.crates.io/ro/wa/rowan`, got 503
Build completed unsuccessfully in 1:44:43

@bors
Copy link
Collaborator

bors commented Feb 27, 2023

⌛ Testing commit cb51d2d with merge e645ba4b3f3446eafec52596b018a2acfaaf484f...

@bors
Copy link
Collaborator

bors commented Feb 27, 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 Feb 27, 2023
@oli-obk
Copy link
Contributor

oli-obk commented Feb 27, 2023

@bors retry could not create temporary file whilst writing archive: no more archived files

@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 Feb 27, 2023
@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
[187/3021] Building CXX object utils/TableGen/CMakeFiles/llvm-tblgen.dir/DecoderEmitter.cpp.obj
[188/3021] Linking CXX static library lib\libLLVMSupport.a
[189/3021] Building CXX object utils/TableGen/CMakeFiles/llvm-tblgen.dir/CodeGenTarget.cpp.obj
[190/3021] Linking CXX static library lib\libLLVMFuzzerCLI.a
FAILED: lib/libLLVMFuzzerCLI.a 
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E rm -f lib\libLLVMFuzzerCLI.a && D:\a\rust\rust\mingw32\bin\ar.exe qc lib\libLLVMFuzzerCLI.a  lib/FuzzMutate/CMakeFiles/LLVMFuzzerCLI.dir/FuzzerCLI.cpp.obj && D:\a\rust\rust\mingw32\bin\ranlib.exe lib\libLLVMFuzzerCLI.a && cd ."
D:\a\rust\rust\mingw32\bin\ranlib.exe: could not create temporary file whilst writing archive: no more archived files
[191/3021] Linking CXX static library lib\libLLVMFileCheck.a
[192/3021] Building CXX object utils/TableGen/CMakeFiles/llvm-tblgen.dir/DAGISelMatcherGen.cpp.obj
[193/3021] Building CXX object utils/TableGen/CMakeFiles/llvm-tblgen.dir/DAGISelMatcherEmitter.cpp.obj
[194/3021] Building CXX object utils/TableGen/CMakeFiles/llvm-tblgen.dir/DirectiveEmitter.cpp.obj
[194/3021] Building CXX object utils/TableGen/CMakeFiles/llvm-tblgen.dir/DirectiveEmitter.cpp.obj
[195/3021] Building CXX object utils/TableGen/CMakeFiles/llvm-tblgen.dir/DFAPacketizerEmitter.cpp.obj
[196/3021] Building CXX object utils/TableGen/CMakeFiles/llvm-tblgen.dir/DAGISelEmitter.cpp.obj
[197/3021] Building CXX object utils/TableGen/CMakeFiles/llvm-tblgen.dir/DAGISelMatcher.cpp.obj
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-1cd66030c949c28d\cmake-0.1.48\src\lib.rs:975:5
 finished in 44.978 seconds
Build completed unsuccessfully in 0:04:09
Build completed unsuccessfully in 0:04:09
make: *** [Makefile:78: ci-mingw-subset-1] Error 1

@bors
Copy link
Collaborator

bors commented Feb 27, 2023

⌛ Testing commit cb51d2d with merge 6290ae9...

@bors
Copy link
Collaborator

bors commented Feb 28, 2023

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing 6290ae9 to master...

1 similar comment
@bors
Copy link
Collaborator

bors commented Feb 28, 2023

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing 6290ae9 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 28, 2023
@bors bors merged commit 6290ae9 into rust-lang:master Feb 28, 2023
@rustbot rustbot added this to the 1.69.0 milestone Feb 28, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (6290ae9): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

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.5% [0.5%, 0.5%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.5% [0.5%, 0.5%] 1

Cycles

This benchmark run did not return any relevant results for this metric.

@cjgillot cjgillot deleted the no-typeck-mir branch February 28, 2023 17:35
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. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants