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

Match scrutinee need necessary parentheses for structs #113679

Merged
merged 1 commit into from
Aug 15, 2023

Conversation

chenyukang
Copy link
Member

Fixes #113459

@rustbot
Copy link
Collaborator

rustbot commented Jul 14, 2023

r? @TaKO8Ki

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

@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 Jul 14, 2023
Copy link
Member

@lukas-code lukas-code left a comment

Choose a reason for hiding this comment

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

This fix looks insufficient for chained operators, for example this still triggers the lint:

struct Foo {}

fn main() {
    match (&&Foo {}) {
        _ => {}
    }
}

I think the correct fix is to add a case for AddrOf to contains_exterior_struct_lit here:

ast::ExprKind::Await(x, _)
| ast::ExprKind::Unary(_, x)
| ast::ExprKind::Cast(x, _)
| ast::ExprKind::Type(x, _)
| ast::ExprKind::Field(x, _)
| ast::ExprKind::Index(x, _) => {
// &X { y: 1 }, X { y: 1 }.y
contains_exterior_struct_lit(x)
}

@chenyukang
Copy link
Member Author

@bors r=cjgillot

@bors
Copy link
Contributor

bors commented Aug 3, 2023

📌 Commit fa9d5e7 has been approved by cjgillot

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 Aug 3, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 3, 2023
… r=cjgillot

Match scrutinee need necessary parentheses for structs

Fixes rust-lang#113459
@bors
Copy link
Contributor

bors commented Aug 4, 2023

⌛ Testing commit fa9d5e7 with merge c2d4b0fd01ca8b5b1acd7e99ede9ba14d7578afe...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Aug 4, 2023

💔 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 Aug 4, 2023
@chenyukang
Copy link
Member Author

@matthiaskrgr
do you know the reason for this failure?
from the log seems it's not caused by code change.

@matthiaskrgr
Copy link
Member

my first thought was that perhaps since the 2 weeks the PR was opened, some other changes went in or additional tests were added which the first version of the pr did not account for, but I didn't look at it in very detail.

@chenyukang
Copy link
Member Author

I rebased to master yesterday, let me rebase it again to have a try.
The log don't have too much info about the error:
#113679 (comment)

@cjgillot
Copy link
Contributor

cjgillot commented Aug 4, 2023

The error is a SIGSEGV on one of the apple builders. Let's try again, see if it's a legitimate failure.
@bors r+

@bors
Copy link
Contributor

bors commented Aug 4, 2023

📌 Commit eb10728643010ce1a95ecea2a7ac5291dc6958ed has been approved by cjgillot

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 Aug 4, 2023
@bors
Copy link
Contributor

bors commented Aug 5, 2023

⌛ Testing commit eb10728643010ce1a95ecea2a7ac5291dc6958ed with merge f933bc7a2f16deeccd550634d5744ce0a76c16aa...

@bors
Copy link
Contributor

bors commented Aug 5, 2023

☀️ Test successful - checks-actions
Approved by: cjgillot
Pushing f933bc7a2f16deeccd550634d5744ce0a76c16aa to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 5, 2023
@bors
Copy link
Contributor

bors commented Aug 5, 2023

👀 Test was successful, but fast-forwarding failed: 422 Update is not a fast forward

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f933bc7a2f16deeccd550634d5744ce0a76c16aa): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

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)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.7% [-1.3%, -0.4%] 44
Improvements ✅
(secondary)
-0.5% [-0.9%, -0.2%] 14
All ❌✅ (primary) -0.7% [-1.3%, -0.4%] 44

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)
-3.6% [-3.6%, -3.6%] 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: 650.779s -> 652.03s (0.19%)

@lqd lqd mentioned this pull request Aug 5, 2023
@klensy
Copy link
Contributor

klensy commented Aug 5, 2023

So, it isn't merged?

@chenyukang
Copy link
Member Author

yes, seems failed in merging.

@chenyukang
Copy link
Member Author

@matthiaskrgr
could you please help me with this PR,
seems it's tested successfully, but it's left un-merged because of the issue of:

 Test was successful, but fast-forwarding failed: 422 Update is not a fast forward

@matthiaskrgr
Copy link
Member

@bors retry

@workingjubilee
Copy link
Member

uhh.

@workingjubilee
Copy link
Member

According to homu, this isn't actually approved.
I am thus reapproving it.

@bors r=cjgillot rollup=never

@bors
Copy link
Contributor

bors commented Aug 15, 2023

📌 Commit c44b35e has been approved by cjgillot

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Aug 15, 2023

⌛ Testing commit c44b35e with merge d7e7510...

@bors
Copy link
Contributor

bors commented Aug 15, 2023

☀️ Test successful - checks-actions
Approved by: cjgillot
Pushing d7e7510 to master...

@bors bors merged commit d7e7510 into rust-lang:master Aug 15, 2023
22 checks passed
@rustbot rustbot added this to the 1.73.0 milestone Aug 15, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d7e7510): 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)
3.1% [1.8%, 6.2%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.0% [-2.0%, -2.0%] 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: 632.706s -> 631.44s (-0.20%)
Artifact size: 346.54 MiB -> 346.64 MiB (0.03%)

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