Skip to content

cleanup mir_borrowck #139666

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 10 commits into from
Apr 14, 2025
Merged

cleanup mir_borrowck #139666

merged 10 commits into from
Apr 14, 2025

Conversation

lcnr
Copy link
Contributor

@lcnr lcnr commented Apr 11, 2025

Cleanup pulled out of #139587. Best reviewed commit by commit.

r? compiler-errors

lcnr added 7 commits April 11, 2025 10:41
This previously incorrectly returned `true` for parent functions whose
first statement was `let local = <coroutine>;`. While that didn't cause
any bugs as we only ever access `movable_coroutine` for `yield`
terminators. It was still wrong.
@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 Apr 11, 2025
@lcnr
Copy link
Contributor Author

lcnr commented Apr 11, 2025

@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 Apr 11, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 11, 2025
cleanup `mir_borrowck`

Cleanup pulled out of rust-lang#139587. Best reviewed commit by commit.

r? compiler-errors
@bors
Copy link
Collaborator

bors commented Apr 11, 2025

⌛ Trying commit 13bd7e0 with merge 92cb866...

@lcnr lcnr force-pushed the pre-revealing-use-cleanup branch from 13bd7e0 to 0097e25 Compare April 11, 2025 10:50
@rust-log-analyzer

This comment has been minimized.

@lcnr lcnr force-pushed the pre-revealing-use-cleanup branch from 0097e25 to 640195a Compare April 11, 2025 11:16
@lcnr

This comment was marked as outdated.

@lcnr
Copy link
Contributor Author

lcnr commented Apr 11, 2025

@rust-timer build 92cb866

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (92cb866): comparison URL.

Overall result: ❌ regressions - 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 the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

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

Max RSS (memory usage)

Results (primary -1.0%, secondary 0.8%)

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.8% [0.4%, 1.3%] 2
Improvements ✅
(primary)
-1.0% [-1.0%, -1.0%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.0% [-1.0%, -1.0%] 1

Cycles

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

Binary size

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

Bootstrap: 781.035s -> 782.175s (0.15%)
Artifact size: 365.98 MiB -> 366.02 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 11, 2025
@@ -465,16 +473,6 @@ fn do_mir_borrowck<'tcx>(

mbcx.report_move_errors();

// If requested, dump polonius MIR.
polonius::dump_polonius_mir(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put the call here because the dump will use the dataflow results just above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as in, moving this is wrong?

it does not access flow_results or the mbcx, so how does the code above impact this output 🤔

Copy link
Member

@lqd lqd Apr 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn’t on master right now but will, when I open the PR to add the full Polonius debugger to its MIR dump: it shows the loans going out of NLL scope for example.

No worries, I will move it back if it needs to, but I also don’t know if I’ll open that PR before needing to rework active loans away from these dataflow results, so it’s fine.

@compiler-errors
Copy link
Member

@bors r+ rollup=maybe

@bors
Copy link
Collaborator

bors commented Apr 13, 2025

📌 Commit 420390c has been approved by compiler-errors

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 Apr 13, 2025
ChrisDenton added a commit to ChrisDenton/rust that referenced this pull request Apr 13, 2025
…compiler-errors

cleanup `mir_borrowck`

Cleanup pulled out of rust-lang#139587. Best reviewed commit by commit.

r? compiler-errors
ChrisDenton added a commit to ChrisDenton/rust that referenced this pull request Apr 13, 2025
…compiler-errors

cleanup `mir_borrowck`

Cleanup pulled out of rust-lang#139587. Best reviewed commit by commit.

r? compiler-errors
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 13, 2025
…enton

Rollup of 12 pull requests

Successful merges:

 - rust-lang#138744 (Add methods to TCP and UDP sockets to modify hop limit (refresh of rust-lang#94678))
 - rust-lang#138962 (Expect an array when expected and acutal types are both arrays during cast)
 - rust-lang#139001 (add `naked_functions_rustic_abi` feature gate)
 - rust-lang#139379 (Use delayed bug for normalization errors in drop elaboration)
 - rust-lang#139582 (Various coercion cleanups)
 - rust-lang#139628 (Suggest remove redundant `$()?` around `vis`)
 - rust-lang#139644 (Micro-optimize `InstSimplify`'s `simplify_primitive_clone`)
 - rust-lang#139666 (cleanup `mir_borrowck`)
 - rust-lang#139674 (In `rustc_mir_transform`, iterate over index newtypes instead of ints)
 - rust-lang#139695 (compiletest: consistently use `camino::{Utf8Path,Utf8PathBuf}` throughout)
 - rust-lang#139722 (Move some things to rustc_type_ir)
 - rust-lang#139740 (Convert `tests/ui/lint/dead-code/self-assign.rs` to a known-bug test)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 14, 2025
Rollup of 9 pull requests

Successful merges:

 - rust-lang#138336 (Improve `-Z crate-attr` diagnostics)
 - rust-lang#139636 (Encode dep node edge count as u32 instead of usize)
 - rust-lang#139666 (cleanup `mir_borrowck`)
 - rust-lang#139695 (compiletest: consistently use `camino::{Utf8Path,Utf8PathBuf}` throughout)
 - rust-lang#139699 (Proactively update coroutine drop shim's phase to account for later passes applied during shim query)
 - rust-lang#139718 (enforce unsafe attributes in pre-2024 editions by default)
 - rust-lang#139722 (Move some things to rustc_type_ir)
 - rust-lang#139760 (UI tests: migrate remaining compile time `error-pattern`s to line annotations when possible)
 - rust-lang#139776 (Switch attrs to `diagnostic::on_unimplemented`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit a642232 into rust-lang:master Apr 14, 2025
6 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 14, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 14, 2025
Rollup merge of rust-lang#139666 - lcnr:pre-revealing-use-cleanup, r=compiler-errors

cleanup `mir_borrowck`

Cleanup pulled out of rust-lang#139587. Best reviewed commit by commit.

r? compiler-errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

7 participants