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

simplify similar_tokens from Option<Vec<_>> to &[_] #135882

Merged
merged 2 commits into from
Jan 30, 2025
Merged

Conversation

hkBst
Copy link
Contributor

@hkBst hkBst commented Jan 22, 2025

All uses immediately invoke contains, so maybe a further simplification is possible.

@rustbot
Copy link
Collaborator

rustbot commented Jan 22, 2025

r? @chenyukang

rustbot has assigned @chenyukang.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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 Jan 22, 2025
@rust-log-analyzer

This comment has been minimized.

@Kobzol
Copy link
Contributor

Kobzol commented Jan 22, 2025

It could even return just &[...], since the slice contents are statically known.

@Kobzol
Copy link
Contributor

Kobzol commented Jan 22, 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 Jan 22, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 22, 2025
simplify similar_tokens from Option<Vec<_>> to Vec<_>

All uses immediately invoke contains, so maybe a further simplification is possible.
@bors
Copy link
Contributor

bors commented Jan 22, 2025

⌛ Trying commit 3e074fd with merge a79c0ff...

@bors
Copy link
Contributor

bors commented Jan 22, 2025

☀️ Try build successful - checks-actions
Build commit: a79c0ff (a79c0ffef22942a9bfa1ddbc06182ca04ae40071)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (a79c0ff): 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.1% [-0.1%, -0.1%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.1% [-0.1%, -0.1%] 1

Max RSS (memory usage)

Results (primary 0.6%, secondary -0.1%)

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

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: 765.273s -> 764.919s (-0.05%)
Artifact size: 325.95 MiB -> 326.00 MiB (0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 22, 2025
@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 23, 2025
@rustbot

This comment has been minimized.

@rustbot rustbot removed has-merge-commits PR has merge commits, merge with caution. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 23, 2025
@estebank
Copy link
Contributor

r? @estebank
@bors r+

@bors
Copy link
Contributor

bors commented Jan 24, 2025

📌 Commit 5f01e12 has been approved by estebank

It is now in the queue for this repository.

@rustbot rustbot assigned estebank and unassigned chenyukang Jan 24, 2025
@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 24, 2025
@workingjubilee workingjubilee changed the title simplify similar_tokens from Option<Vec<_>> to Vec<_> simplify similar_tokens from Option<Vec<_>> to &[_] Jan 24, 2025
@compiler-errors
Copy link
Member

@bors rollup=maybe

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 30, 2025
simplify `similar_tokens` from `Option<Vec<_>>` to `&[_]`

All uses immediately invoke contains, so maybe a further simplification is possible.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 30, 2025
simplify `similar_tokens` from `Option<Vec<_>>` to `&[_]`

All uses immediately invoke contains, so maybe a further simplification is possible.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 30, 2025
simplify `similar_tokens` from `Option<Vec<_>>` to `&[_]`

All uses immediately invoke contains, so maybe a further simplification is possible.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 30, 2025
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#133636 ([rustdoc] Add sans-serif font setting)
 - rust-lang#135434 (Match Ergonomics 2024: update edition 2024 behavior of feature gates)
 - rust-lang#135739 (Clean up uses of the unstable `dwarf_version` option)
 - rust-lang#135882 (simplify `similar_tokens` from `Option<Vec<_>>` to `&[_]`)
 - rust-lang#136179 (Allow transmuting generic pattern types to and from their base)
 - rust-lang#136199 (Fix a couple Emscripten tests)
 - rust-lang#136238 (ci: refactor how directories are removed in free-disk-space disk)
 - rust-lang#136251 (use impl Into<String> instead of explicit type args with bounds)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 30, 2025
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#133636 ([rustdoc] Add sans-serif font setting)
 - rust-lang#135434 (Match Ergonomics 2024: update edition 2024 behavior of feature gates)
 - rust-lang#135739 (Clean up uses of the unstable `dwarf_version` option)
 - rust-lang#135882 (simplify `similar_tokens` from `Option<Vec<_>>` to `&[_]`)
 - rust-lang#136179 (Allow transmuting generic pattern types to and from their base)
 - rust-lang#136199 (Fix a couple Emscripten tests)
 - rust-lang#136251 (use impl Into<String> instead of explicit type args with bounds)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 78ded09 into rust-lang:master Jan 30, 2025
6 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Jan 30, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 30, 2025
Rollup merge of rust-lang#135882 - hkBst:master, r=estebank

simplify `similar_tokens` from `Option<Vec<_>>` to `&[_]`

All uses immediately invoke contains, so maybe a further simplification is possible.
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.

9 participants