Skip to content

fix: Reject upvar scrutinees for loop_match #144451

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

Merged
merged 1 commit into from
Jul 29, 2025

Conversation

ShoyuVanilla
Copy link
Member

Fixes #144051

I think we should reject upvars as they are not locals but somewhat like field access

@rustbot
Copy link
Collaborator

rustbot commented Jul 25, 2025

r? @oli-obk

rustbot has assigned @oli-obk.
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 Jul 25, 2025
@folkertdev folkertdev added the F-loop_match when you match up with someone and they really throw you for a loop label Jul 27, 2025
Copy link
Contributor

@folkertdev folkertdev left a comment

Choose a reason for hiding this comment

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

Thanks for tackling this issue! Rejecting upvars as an approach seems correct to me.

Copy link
Contributor

@oli-obk oli-obk left a comment

Choose a reason for hiding this comment

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

r=me with nit

@bors
Copy link
Collaborator

bors commented Jul 28, 2025

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

@ShoyuVanilla
Copy link
Member Author

@bors r=oli-obk

@bors
Copy link
Collaborator

bors commented Jul 28, 2025

📌 Commit d87b4f2 has been approved by oli-obk

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 Jul 28, 2025
Zalathar added a commit to Zalathar/rust that referenced this pull request Jul 29, 2025
…li-obk

fix: Reject upvar scrutinees for `loop_match`

Fixes rust-lang#144051

I think we should reject upvars as they are not locals but somewhat like field access
bors added a commit that referenced this pull request Jul 29, 2025
Rollup of 14 pull requests

Successful merges:

 - #144022 (Implementation: `#[feature(sync_nonpoison)]`, `#[feature(nonpoison_mutex)]`)
 - #144167 (Document why `Range*<&T> as RangeBounds<T>` impls are not `T: ?Sized`, and give an alternative.)
 - #144407 (fix(debuginfo): disable overflow check for recursive non-enum types)
 - #144451 (fix: Reject upvar scrutinees for `loop_match`)
 - #144482 (Add explicit download methods to download module in bootstrap)
 - #144500 (thread name in stack overflow message)
 - #144511 (tidy: increase performance of auto extra checks feature)
 - #144586 (Update wasi-sdk to 27.0 in CI)
 - #144599 (bootstrap: enable tidy auto extra checks on tools profile)
 - #144600 (Ensure external paths passed via flags end up in rustdoc depinfo)
 - #144609 (feat: Right align line numbers)
 - #144623 (miri subtree update)
 - #144626 (cc dependencies: clarify comment)
 - #144627 (Add a test case for the issue #129882)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Jul 29, 2025
Rollup of 13 pull requests

Successful merges:

 - #144022 (Implementation: `#[feature(sync_nonpoison)]`, `#[feature(nonpoison_mutex)]`)
 - #144167 (Document why `Range*<&T> as RangeBounds<T>` impls are not `T: ?Sized`, and give an alternative.)
 - #144407 (fix(debuginfo): disable overflow check for recursive non-enum types)
 - #144451 (fix: Reject upvar scrutinees for `loop_match`)
 - #144482 (Add explicit download methods to download module in bootstrap)
 - #144500 (thread name in stack overflow message)
 - #144511 (tidy: increase performance of auto extra checks feature)
 - #144599 (bootstrap: enable tidy auto extra checks on tools profile)
 - #144600 (Ensure external paths passed via flags end up in rustdoc depinfo)
 - #144609 (feat: Right align line numbers)
 - #144623 (miri subtree update)
 - #144626 (cc dependencies: clarify comment)
 - #144627 (Add a test case for the issue #129882)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit dbcf168 into rust-lang:master Jul 29, 2025
10 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 29, 2025
@ShoyuVanilla ShoyuVanilla deleted the loop-match-upvar branch July 29, 2025 13:38
rust-timer added a commit that referenced this pull request Jul 29, 2025
Rollup merge of #144451 - ShoyuVanilla:loop-match-upvar, r=oli-obk

fix: Reject upvar scrutinees for `loop_match`

Fixes #144051

I think we should reject upvars as they are not locals but somewhat like field access
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Aug 1, 2025
Rollup of 13 pull requests

Successful merges:

 - rust-lang/rust#144022 (Implementation: `#[feature(sync_nonpoison)]`, `#[feature(nonpoison_mutex)]`)
 - rust-lang/rust#144167 (Document why `Range*<&T> as RangeBounds<T>` impls are not `T: ?Sized`, and give an alternative.)
 - rust-lang/rust#144407 (fix(debuginfo): disable overflow check for recursive non-enum types)
 - rust-lang/rust#144451 (fix: Reject upvar scrutinees for `loop_match`)
 - rust-lang/rust#144482 (Add explicit download methods to download module in bootstrap)
 - rust-lang/rust#144500 (thread name in stack overflow message)
 - rust-lang/rust#144511 (tidy: increase performance of auto extra checks feature)
 - rust-lang/rust#144599 (bootstrap: enable tidy auto extra checks on tools profile)
 - rust-lang/rust#144600 (Ensure external paths passed via flags end up in rustdoc depinfo)
 - rust-lang/rust#144609 (feat: Right align line numbers)
 - rust-lang/rust#144623 (miri subtree update)
 - rust-lang/rust#144626 (cc dependencies: clarify comment)
 - rust-lang/rust#144627 (Add a test case for the issue rust-lang/rust#129882)

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-loop_match when you match up with someone and they really throw you for a loop 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.

ICE loop match: None in compiler/rustc_mir_build/src/builder/scope.rs
5 participants