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

Merge PatKind::Path into PatKind::Lit #134248

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

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Dec 13, 2024

Follow-up to #134228

We always had a duplication where Paths could be represented as PatKind::Path or PatKind::Lit(ExprKind::Path). We had to handle both everywhere, and still do after #134228, so I'm removing it now.

@rustbot
Copy link
Collaborator

rustbot commented Dec 13, 2024

r? @BoxyUwU

rustbot has assigned @BoxyUwU.
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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Dec 13, 2024
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the patkind-path-removal branch from 7cee193 to eb60270 Compare December 13, 2024 09:20
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the patkind-path-removal branch from eb60270 to a29a302 Compare December 13, 2024 10:20
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the patkind-path-removal branch 2 times, most recently from 40adfed to 25dae36 Compare December 18, 2024 10:13
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 18, 2024
…ler-errors

Forbid overwriting types in typeck

While trying to figure out some type setting logic in rust-lang#134248 I realized that we sometimes set a type twice. While hopefully that would have been the same type, we didn't ensure that at all and just silently accepted it. So now we reject setting it twice, unless errors are happening, then we don't care.

Best reviewed commit by commit.

No behaviour change is intended.
jieyouxu added a commit to jieyouxu/rust that referenced this pull request Dec 19, 2024
…ler-errors

Forbid overwriting types in typeck

While trying to figure out some type setting logic in rust-lang#134248 I realized that we sometimes set a type twice. While hopefully that would have been the same type, we didn't ensure that at all and just silently accepted it. So now we reject setting it twice, unless errors are happening, then we don't care.

Best reviewed commit by commit.

No behaviour change is intended.
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Dec 19, 2024
Rollup merge of rust-lang#134474 - oli-obk:push-yomnkntvzlxw, r=compiler-errors

Forbid overwriting types in typeck

While trying to figure out some type setting logic in rust-lang#134248 I realized that we sometimes set a type twice. While hopefully that would have been the same type, we didn't ensure that at all and just silently accepted it. So now we reject setting it twice, unless errors are happening, then we don't care.

Best reviewed commit by commit.

No behaviour change is intended.
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Dec 20, 2024
Forbid overwriting types in typeck

While trying to figure out some type setting logic in rust-lang/rust#134248 I realized that we sometimes set a type twice. While hopefully that would have been the same type, we didn't ensure that at all and just silently accepted it. So now we reject setting it twice, unless errors are happening, then we don't care.

Best reviewed commit by commit.

No behaviour change is intended.
lnicola pushed a commit to lnicola/rust-analyzer that referenced this pull request Dec 23, 2024
Forbid overwriting types in typeck

While trying to figure out some type setting logic in rust-lang/rust#134248 I realized that we sometimes set a type twice. While hopefully that would have been the same type, we didn't ensure that at all and just silently accepted it. So now we reject setting it twice, unless errors are happening, then we don't care.

Best reviewed commit by commit.

No behaviour change is intended.
@bors
Copy link
Contributor

bors commented Dec 26, 2024

☔ The latest upstream changes (presumably #134788) made this pull request unmergeable. Please resolve the merge conflicts.

@oli-obk oli-obk force-pushed the patkind-path-removal branch 2 times, most recently from 2f05ee6 to 1be4ad1 Compare January 7, 2025 10:07
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the patkind-path-removal branch from 1be4ad1 to 2269e1f Compare January 7, 2025 10:19
@oli-obk
Copy link
Contributor Author

oli-obk commented Jan 7, 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 7, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 7, 2025
Merge `PatKind::Path` into `PatKind::Lit`

Follow-up to rust-lang#134228

We always had a duplication where `Path`s could be represented as `PatKind::Path` or `PatKind::Lit(ExprKind::Path)`. We had to handle both everywhere, and still do after rust-lang#134228, so I'm removing it now. subsequently we can also nuke `visit_pattern_type_pattern`
@bors
Copy link
Contributor

bors commented Jan 7, 2025

⌛ Trying commit 2269e1f with merge 801e8e4...

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the patkind-path-removal branch from 6a6e2ae to e1ee023 Compare January 17, 2025 12:03
@oli-obk
Copy link
Contributor Author

oli-obk commented Jan 17, 2025

@rust-timer build 995b2b4

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (995b2b4): comparison URL.

Overall result: ❌ regressions - please read the text below

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.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@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)
1.2% [0.1%, 4.8%] 12
Regressions ❌
(secondary)
0.1% [0.1%, 0.4%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.2% [0.1%, 4.8%] 12

Max RSS (memory usage)

Results (primary 0.7%, secondary 1.7%)

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.7% [1.4%, 2.0%] 3
Regressions ❌
(secondary)
1.7% [1.7%, 1.7%] 1
Improvements ✅
(primary)
-2.3% [-2.3%, -2.3%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.7% [-2.3%, 2.0%] 4

Cycles

Results (primary 1.1%, secondary -2.0%)

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)
2.7% [1.6%, 3.7%] 4
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.0% [-2.5%, -1.5%] 2
Improvements ✅
(secondary)
-2.0% [-2.0%, -2.0%] 1
All ❌✅ (primary) 1.1% [-2.5%, 3.7%] 6

Binary size

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

Bootstrap: 764.62s -> 762.612s (-0.26%)
Artifact size: 326.02 MiB -> 326.03 MiB (0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 17, 2025
@oli-obk
Copy link
Contributor Author

oli-obk commented Jan 17, 2025

I'm going a bit mad here. I can't tell what could possibly cause incremental cache invalidations causing the queries to be recomputed.

@oli-obk oli-obk force-pushed the patkind-path-removal branch from e1ee023 to 9d7525b Compare January 17, 2025 15:56
@oli-obk
Copy link
Contributor Author

oli-obk commented Jan 17, 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 17, 2025
@oli-obk
Copy link
Contributor Author

oli-obk commented Jan 17, 2025

trying without the actual PatKind::Path elimination, to make sure it's not related to the preceding commits

@bors
Copy link
Contributor

bors commented Jan 17, 2025

⌛ Trying commit 9d7525b with merge dbdec20ac1ab520aba07b8f34c6f1cf35d061a63...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 17, 2025
Merge `PatKind::Path` into `PatKind::Lit`

Follow-up to rust-lang#134228

We always had a duplication where `Path`s could be represented as `PatKind::Path` or `PatKind::Lit(ExprKind::Path)`. We had to handle both everywhere, and still do after rust-lang#134228, so I'm removing it now.
@Nadrieril
Copy link
Member

deref patterns need to support literals having a different type than the pattern (e.g. &str pattern for String types)

Is that deref_patterns (the one with an explicit deref! syntax) or string_deref_patterns (the one just for strings)? If it's string_deref_patterns you can drop that gate, it's not part of any larger design at the moment and not implemented very cleanly imo.

Tho while writing this I realized we could add a new side table for such transformations... gonna try that

That's how we handle when match ergonomics change types so that sounds good.

@oli-obk
Copy link
Contributor Author

oli-obk commented Jan 20, 2025

@rust-timer build dbdec20

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (dbdec20): 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.8%, secondary -0.2%)

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)
3.6% [3.6%, 3.6%] 1
Improvements ✅
(primary)
-1.8% [-1.8%, -1.8%] 1
Improvements ✅
(secondary)
-4.0% [-4.0%, -4.0%] 1
All ❌✅ (primary) -1.8% [-1.8%, -1.8%] 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: 764.673s -> 764.873s (0.03%)
Artifact size: 326.10 MiB -> 326.08 MiB (-0.01%)

@rustbot rustbot removed S-waiting-on-perf Status: Waiting on a perf run to be completed. perf-regression Performance regression. labels Jan 20, 2025
@oli-obk
Copy link
Contributor Author

oli-obk commented Jan 20, 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 20, 2025
@bors
Copy link
Contributor

bors commented Jan 20, 2025

⌛ Trying commit d327296 with merge 0b20e85...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 20, 2025
Merge `PatKind::Path` into `PatKind::Lit`

Follow-up to rust-lang#134228

We always had a duplication where `Path`s could be represented as `PatKind::Path` or `PatKind::Lit(ExprKind::Path)`. We had to handle both everywhere, and still do after rust-lang#134228, so I'm removing it now.
@bors
Copy link
Contributor

bors commented Jan 20, 2025

☀️ Try build successful - checks-actions
Build commit: 0b20e85 (0b20e8534dab145fb6b72422132b00db3f76db6e)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0b20e85): 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 (primary 1.1%, secondary -0.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)
1.1% [1.1%, 1.1%] 1
Regressions ❌
(secondary)
1.4% [0.6%, 3.1%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.0% [-3.6%, -2.3%] 2
All ❌✅ (primary) 1.1% [1.1%, 1.1%] 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: 766.411s -> 764.6s (-0.24%)
Artifact size: 325.99 MiB -> 326.01 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc 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