Skip to content

Make most rustc_type_ir kinds Copy by default - #118841

Merged
bors merged 2 commits into
rust-lang:masterfrom
compiler-errors:always-copy
Dec 12, 2023
Merged

Make most rustc_type_ir kinds Copy by default#118841
bors merged 2 commits into
rust-lang:masterfrom
compiler-errors:always-copy

Conversation

@compiler-errors

Copy link
Copy Markdown
Contributor
  1. There's no reason why TyKind and ConstKind/ConstData can't be Copy. This allows us to avoid needing a typed arena for the two types.
  2. Simplify some impls into derives.

@compiler-errors

Copy link
Copy Markdown
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot

rustbot commented Dec 11, 2023

Copy link
Copy Markdown
Collaborator

r? @BoxyUwU

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

@rustbot rustbot added S-waiting-on-perf Status: Waiting on a perf run to be completed. 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 Dec 11, 2023
@bors

bors commented Dec 11, 2023

Copy link
Copy Markdown
Collaborator

⌛ Trying commit 985f378 with merge e918fba...

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 11, 2023
Make most `rustc_type_ir` kinds `Copy` by default

1. There's no reason why `TyKind` and `ConstKind`/`ConstData` can't be `Copy`. This allows us to avoid needing a typed arena for the two types.
2. Simplify some impls into derives.
@rust-log-analyzer

This comment has been minimized.

@jackh726

Copy link
Copy Markdown
Member

It might be too late for this, but should be careful.

At one point, rust-analyzer's types were not Copy. Not sure if that's still the case.

@bors

bors commented Dec 11, 2023

Copy link
Copy Markdown
Collaborator

☀️ Try build successful - checks-actions
Build commit: e918fba (e918fba6d9e21e705af4f04b1332fe2b3f820b93)

@rust-timer

This comment has been minimized.

@compiler-errors

Copy link
Copy Markdown
Contributor Author

The non-rustc_type_ir part of this PR has nothing to do with RA needing Clone-only types. We can still make the code in rustc_type_ir and rustc_next_trait_solver depend on Clone only without doing much work.

As for the implementations I removed, I can re-add them if rust-analyzer needs them. Until then, I'd rather simplify the code. @lcnr also has discussed a bit with the r-a folks about needing Copy-only types: https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/interning.20and.20requiring.20.60Copy.60/near/404852245

@jackh726

Copy link
Copy Markdown
Member

Yeah, happy to simplify now and revert back things as needed! Just figured I'd bring this up.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (e918fba): comparison URL.

Overall result: no relevant changes - 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 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
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.6% [-0.6%, -0.6%] 1
Improvements ✅
(secondary)
-2.3% [-2.3%, -2.3%] 1
All ❌✅ (primary) -0.6% [-0.6%, -0.6%] 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: 670.568s -> 670.86s (0.04%)
Artifact size: 314.19 MiB -> 314.21 MiB (0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 12, 2023
@compiler-errors

Copy link
Copy Markdown
Contributor Author

cool

@rustbot ready

@jackh726

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Dec 12, 2023

Copy link
Copy Markdown
Collaborator

📌 Commit f3218b2 has been approved by jackh726

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 Dec 12, 2023
@BoxyUwU

BoxyUwU commented Dec 12, 2023

Copy link
Copy Markdown
Member

r? @jackh726

@rustbot rustbot assigned jackh726 and unassigned BoxyUwU Dec 12, 2023
@bors

bors commented Dec 12, 2023

Copy link
Copy Markdown
Collaborator

⌛ Testing commit f3218b2 with merge 27d8a57...

@bors

bors commented Dec 12, 2023

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-actions
Approved by: jackh726
Pushing 27d8a57 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 12, 2023
@bors
bors merged commit 27d8a57 into rust-lang:master Dec 12, 2023
@rustbot rustbot added this to the 1.76.0 milestone Dec 12, 2023
@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (27d8a57): 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
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.2% [-1.2%, -1.2%] 1
All ❌✅ (primary) - - 0

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: 673.595s -> 673.136s (-0.07%)
Artifact size: 312.31 MiB -> 312.33 MiB (0.01%)

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.

7 participants