Skip to content

fix(rustc_codegen_ssa): Use cg_operand for Freeze check#157953

Open
cordx56 wants to merge 1 commit into
rust-lang:mainfrom
cordx56:fix-rustc_codegen_ssa-ice
Open

fix(rustc_codegen_ssa): Use cg_operand for Freeze check#157953
cordx56 wants to merge 1 commit into
rust-lang:mainfrom
cordx56:fix-rustc_codegen_ssa-ice

Conversation

@cordx56

@cordx56 cordx56 commented Jun 16, 2026

Copy link
Copy Markdown

Hi, this is my first contribution, so please forgive my incorrect conventions...
I found that #157922 is simple issue.

Fixes #157922

Cause of issue

In rustc_codegen_ssa/src/mir/rvalue.rs, Freeze check is called for non-monomorphized operand pointee type of RValue.
Before this method call, there is already called codegen_operand method for the operand, so I use this for Freeze check.

@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 Jun 16, 2026
@rustbot

rustbot commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @adwinwhite (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue
Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: codegen, compiler
  • codegen, compiler expanded to 73 candidates
  • Random selection from 21 candidates

@nikic nikic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you please also add a test case?

View changes since this review

Comment thread compiler/rustc_codegen_ssa/src/mir/rvalue.rs Outdated
@rustbot

This comment has been minimized.

@cordx56

cordx56 commented Jun 16, 2026

Copy link
Copy Markdown
Author

@rustbot ready

I'm not confident with the place I added a test,

Comment thread tests/ui/generics/ssa-rval-monomorphization-issue-157922.rs
@cordx56

cordx56 commented Jun 16, 2026

Copy link
Copy Markdown
Author

@rustbot ready

@bjorn3

bjorn3 commented Jun 16, 2026

Copy link
Copy Markdown
Member

As indicated by rustbot, would you mind removing the issue reference from the commit to avoid backreference spam on the issue?

@cordx56 cordx56 force-pushed the fix-rustc_codegen_ssa-ice branch from 9d05c78 to 0562f05 Compare June 16, 2026 09:13
@cordx56

cordx56 commented Jun 16, 2026

Copy link
Copy Markdown
Author

@rustbot ready

Comment thread tests/ui/generics/ssa-rval-monomorphization-issue-157922.rs Outdated
Comment thread tests/ui/generics/ssa-rval-monomorphization-issue-157922.rs Outdated
@RalfJung

Copy link
Copy Markdown
Member

@bors squash

@rust-bors

This comment has been minimized.

* fix(rustc_codegen_ssa): Use cg_operand for Freeze check
* chore: remove unnecessary comment
* test: add test for ssa rval monomorphization issue
* fix: move ssa-rval-monomorphization test
* tweak comment

Co-authored-by: Ralf Jung <post@ralfj.de>
@rust-bors

rust-bors Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

🔨 5 commits were squashed into 209ea47.

@rust-bors rust-bors Bot force-pushed the fix-rustc_codegen_ssa-ice branch from f517ccd to 209ea47 Compare June 16, 2026 14:07
@RalfJung

Copy link
Copy Markdown
Member

Thanks, LGTM!
@bors r+ rollup

@rust-bors

rust-bors Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 209ea47 has been approved by RalfJung

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Jun 16, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 16, 2026
… r=RalfJung

fix(rustc_codegen_ssa): Use cg_operand for Freeze check

Hi, this is my first contribution, so please forgive my incorrect conventions...
I found that rust-lang#157922 is simple issue.

Fixes rust-lang#157922

## Cause of issue

In `rustc_codegen_ssa/src/mir/rvalue.rs`, `Freeze` check is called for non-monomorphized operand pointee type of `RValue`.
Before this method call, there is already called `codegen_operand` method for the operand, so I use this for `Freeze` check.
rust-bors Bot pushed a commit that referenced this pull request Jun 16, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - #155535 (export symbols: support macos/windows(32/64))
 - #156538 (Refactor `AliasTy`. `AliasTerm` & `UnevaluatedConst` to use `Alias`)
 - #156807 (Add `T: PartialEq` bounds to derived `StructuralPartialEq` impls.)
 - #156950 (Staticlib rename internal symbols)
 - #157702 (Add expansion info to implied bounds)
 - #155616 (constify `TryFrom<Vec>` for array)
 - #156226 (diagnostics: point to coroutine body on higher-ranked auto trait errors)
 - #157873 (mips: set llvm_args -mno-check-zero-division for all mips targets)
 - #157953 (fix(rustc_codegen_ssa): Use cg_operand for Freeze check)
 - #157958 (doc: Document `-Zlint-rust-version`)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 16, 2026
… r=RalfJung

fix(rustc_codegen_ssa): Use cg_operand for Freeze check

Hi, this is my first contribution, so please forgive my incorrect conventions...
I found that rust-lang#157922 is simple issue.

Fixes rust-lang#157922

## Cause of issue

In `rustc_codegen_ssa/src/mir/rvalue.rs`, `Freeze` check is called for non-monomorphized operand pointee type of `RValue`.
Before this method call, there is already called `codegen_operand` method for the operand, so I use this for `Freeze` check.
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.

[ICE]: Regression: cannot find P/#0 in param-env

6 participants