Skip to content

Reduce ast::ptr::P to a typedef of Box #141603

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

nnethercote
Copy link
Contributor

@nnethercote nnethercote commented May 26, 2025

As per the MCP at rust-lang/compiler-team#878.

r? @fee1-dead

These date back to 2014. I don't think they're needed any more.
It's barely used, and the places that use it are better if they don't.
A `Vec` is fine, the additional word (vector vs. boxed slice) doesn't
matter here.
It's no longer used.
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 26, 2025
@nnethercote
Copy link
Contributor Author

@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 May 26, 2025
@bors
Copy link
Collaborator

bors commented May 26, 2025

⌛ Trying commit fc6c96f with merge 968f45f...

bors added a commit that referenced this pull request May 26, 2025
Reduce `ast::ptr::P` to a typedef of `Box`

r? `@ghost`
@bors
Copy link
Collaborator

bors commented May 26, 2025

☀️ Try build successful - checks-actions
Build commit: 968f45f (968f45f8d7910a081aab4cb3891801bc88a9bba6)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (968f45f): 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 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
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.1% [-0.2%, -0.1%] 6
All ❌✅ (primary) - - 0

Max RSS (memory usage)

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

Cycles

Results (secondary -1.3%)

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.3% [-1.4%, -1.2%] 2
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 778.13s -> 778.268s (0.02%)
Artifact size: 366.42 MiB -> 366.39 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 27, 2025
@nnethercote
Copy link
Contributor Author

Perf effect is somewhere between neutral and slightly improved.

Keep the `P` constructor function for now, to minimize immediate churn.

All the `into_inner` calls are removed, which is nice.
@fee1-dead
Copy link
Member

If you need a reviewer for after the MCP passes, I can help

@nnethercote
Copy link
Contributor Author

Waiting on approval for rust-lang/compiler-team#878.

@nnethercote nnethercote marked this pull request as ready for review June 6, 2025 04:35
@rustbot
Copy link
Collaborator

rustbot commented Jun 6, 2025

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 6, 2025
@nnethercote
Copy link
Contributor Author

The MCP has been approved, this is ready to proceed.

Copy link
Member

@fee1-dead fee1-dead left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines 122 to +123
// FIXME: Use an 'if let' guard once they are implemented
if let ast::StmtKind::Item(i) = stmt.into_inner().kind {
(i, true)
} else {
unreachable!()
}
if let ast::StmtKind::Item(i) = stmt.kind { (i, true) } else { unreachable!() }
Copy link
Member

Choose a reason for hiding this comment

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

This can be fixed. I'll do so in a followup.

Comment on lines +2276 to +2278
if matches!(inner_pat.clone().kind, PatKind::Ident(..)) =>
{
match inner_pat.clone().into_inner().kind {
match inner_pat.clone().kind {
Copy link
Member

Choose a reason for hiding this comment

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

this also

@fee1-dead
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jun 6, 2025

📌 Commit 991c91f has been approved by fee1-dead

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 Jun 6, 2025
@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 Jun 6, 2025
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.

5 participants