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 8 pull requests #120196

Merged
merged 20 commits into from
Jan 22, 2024
Merged

Rollup of 8 pull requests #120196

merged 20 commits into from
Jan 22, 2024

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

atouchet and others added 20 commits January 15, 2024 13:57
We were able to uplift any value from `Tables` to `'static`, which is unsound.
The internal function was unsound, it could cause UB in rare cases where
the user inadvertly stored the returned object in a location that could
outlive the TyCtxt.

In order to make it safe, we now take a type context as an argument to
the internal fn, and we ensure that interned items are lifted using the
provided context.

Thus, this change ensures that the compiler can properly enforce
that the object does not outlive the type context it was lifted to.
InPlaceDstBufDrop holds onto the allocation before the shrinking happens
which means it must deallocate the destination elements but the source
allocation.
Added back previously available exports:

* Forward/Backward: used when implementing `AnalysisDomain`
* Engine: used in user's code to solve the dataflow problem
* SwitchIntEdgeEffects: used when implementing functions of the `Analysis` trait
* graphviz: potentially useful for debugging purposes

These exports are used when implementing external tools based on MIR
dataflow framework.

Closes rust-lang#120130
Update Readme

A couple minor formatting fixes and re-add missing "Installing from Source" section to the table of contents.
…nval

Make stable_mir::with_tables sound

See the first commit for the actual soundness fix. The rest is just fallout from that and is entirely safe code. Includes most of rust-lang#120120

The major difference to rust-lang#120120 is that we don't need an unsafe trait, as we can now rely on the type system (the only unsafe part, and the actual source of the unsoundness was in `with_tables`)

r? `@celinval`
…uviper

fix: Drop guard was deallocating with the incorrect size

InPlaceDstBufDrop holds onto the allocation before the shrinking happens which means it must deallocate the destination elements but the source allocation.

Thanks `@cuviper` for spotting this.
…thercote

`rustc_mir_dataflow`: Restore removed exports

Added back previously available exports:

* `Forward`/`Backward`: used when implementing `AnalysisDomain`
* `Engine`: used in user's code to solve the dataflow problem
* `SwitchIntEdgeEffects`: used when implementing functions of the `Analysis` trait
* `graphviz`: potentially useful for debugging purposes

Closes rust-lang#120130
Capture the rationale for `-Zallow-features=` in bootstrap.py

Based on the discussion in rust-lang#120096.
…r=dtolnay

Warn users about limited review for tier 2 and 3 code

Needs rust-lang/std-dev-guide#61
…s, r=dtolnay

Document some alternatives to `Vec::split_off`

One of the discussion points that came up in rust-lang#119917 is that some people use `Vec::split_off` in cases where they probably shouldn't, because the alternatives (like `mem::take`) are hard to discover.

This PR adds some suggestions to the documentation of `split_off` that should point people towards alternatives that might be more appropriate for their use-case.

I've deliberately tried to keep these changes as simple and uncontroversial as possible, so that they don't depend on how the team decides to handle the concerns raised in rust-lang#119917. That's why I haven't touched the existing documentation for `split_off`, and haven't added links to `split_off` to the documentation of other methods.
@rustbot rustbot added A-meta Area: Issues & PRs about the rust-lang/rust repository itself S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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. rollup A PR which is a rollup labels Jan 21, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=9

@bors
Copy link
Contributor

bors commented Jan 21, 2024

📌 Commit 3eb7fe3 has been approved by matthiaskrgr

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 Jan 21, 2024
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@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 Jan 21, 2024
@bors
Copy link
Contributor

bors commented Jan 21, 2024

⌛ Testing commit 3eb7fe3 with merge 053f259...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 21, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#120005 (Update Readme)
 - rust-lang#120045 (Un-hide `iter::repeat_n`)
 - rust-lang#120128 (Make stable_mir::with_tables sound)
 - rust-lang#120145 (fix: Drop guard was deallocating with the incorrect size)
 - rust-lang#120158 (`rustc_mir_dataflow`: Restore removed exports)
 - rust-lang#120167 (Capture the rationale for `-Zallow-features=` in bootstrap.py)
 - rust-lang#120174 (Warn users about limited review for tier 2 and 3 code)
 - rust-lang#120180 (Document some alternatives to `Vec::split_off`)

Failed merges:

 - rust-lang#120171 (Fix assume and assert in jump threading)

r? `@ghost`
`@rustbot` modify labels: rollup
@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
test core::builder::tests::test_invalid ... ok
test core::builder::tests::test_valid ... ok
test core::config::config::tests::clap_verify ... ok
test core::config::config::tests::detect_src_and_out ... ok
##[error]The runner has received a shutdown signal. This can happen when the runner service is stopped, or a manually started runner is canceled.
##[group]Clock drift check
  local time: Mon Jan 22 00:01:46 UTC 2024
  local time: Mon Jan 22 00:01:46 UTC 2024
Session terminated, killing shell... ...killed.
##[error]The operation was canceled.
Cleaning up orphan processes

@bors
Copy link
Contributor

bors commented Jan 22, 2024

💔 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 Jan 22, 2024
@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 Jan 22, 2024
@bors
Copy link
Contributor

bors commented Jan 22, 2024

⌛ Testing commit 3eb7fe3 with merge 6fff796...

@bors
Copy link
Contributor

bors commented Jan 22, 2024

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 6fff796 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 22, 2024
@bors bors merged commit 6fff796 into rust-lang:master Jan 22, 2024
12 checks passed
@rustbot rustbot added this to the 1.77.0 milestone Jan 22, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#120005 Update Readme 021645225147ca228af02f5919f6c8c0542b22d2 (link)
#120045 Un-hide iter::repeat_n c18ad39bfe8ccb50bebf1429b6481a14fa481a79 (link)
#120128 Make stable_mir::with_tables sound 4444a10bae7500f0d7de88390ae688b4d7772b3b (link)
#120145 fix: Drop guard was deallocating with the incorrect size 8b8d48437dd0806a8432b30e8480f0e573860cc5 (link)
#120158 rustc_mir_dataflow: Restore removed exports 279f499e352d803fa9bbba8474919a7515d7b4ca (link)
#120167 Capture the rationale for -Zallow-features= in bootstrap.… 648553beafafaff4c31d444209e6636524cb4a4b (link)
#120174 Warn users about limited review for tier 2 and 3 code 079b0c76d07273763db5050b883467b38ccb155c (link)
#120180 Document some alternatives to Vec::split_off 8966bb2b782cd3a1c42d996e57205eb0d876abc1 (link)

previous master: a58ec8ff03

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 (6fff796): comparison URL.

Overall result: ❌ regressions - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

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)
1.3% [1.3%, 1.3%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.3% [1.3%, 1.3%] 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)
4.3% [2.7%, 6.2%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 4.3% [2.7%, 6.2%] 3

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

Binary size

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

Bootstrap: 664.028s -> 662.296s (-0.26%)
Artifact size: 308.38 MiB -> 308.38 MiB (-0.00%)

@rustbot rustbot added the perf-regression Performance regression. label Jan 22, 2024
@Kobzol
Copy link
Contributor

Kobzol commented Jan 22, 2024

The regression is not very important I think, and it looks like it has been blipping recently. Still, it would be nice to know where it came from.

@rust-timer build 8b8d484

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (8b8d484): comparison URL.

Overall result: ❌ regressions - ACTION NEEDED

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)
1.3% [1.3%, 1.3%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.3% [1.3%, 1.3%] 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)
4.0% [2.2%, 6.3%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.5% [-1.5%, -1.5%] 1
All ❌✅ (primary) 4.0% [2.2%, 6.3%] 3

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)
1.2% [1.2%, 1.2%] 1
Regressions ❌
(secondary)
2.9% [1.4%, 3.9%] 11
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.2% [1.2%, 1.2%] 1

Binary size

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

Bootstrap: 664.028s -> 662.942s (-0.16%)
Artifact size: 308.38 MiB -> 308.46 MiB (0.03%)

@Kobzol
Copy link
Contributor

Kobzol commented Jan 22, 2024

Yeah, #120145 was probably the cause, that was a correctness fix, so marking as triaged.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Jan 22, 2024
@matthiaskrgr matthiaskrgr deleted the rollup-id2zocf 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
A-meta Area: Issues & PRs about the rust-lang/rust repository itself merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. 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-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.