Skip to content

Added file check to mir-opt/return_an_array.rs#153220

Open
milosilo-dev wants to merge 4 commits intorust-lang:mainfrom
milosilo-dev:main
Open

Added file check to mir-opt/return_an_array.rs#153220
milosilo-dev wants to merge 4 commits intorust-lang:mainfrom
milosilo-dev:main

Conversation

@milosilo-dev
Copy link

@milosilo-dev milosilo-dev commented Feb 28, 2026

I have added file checks to this file after reading #116971, I have only done one file because i want some feedback on weather I am doing it correctly or weather I am confused.

Any feedback would be greatly appreciated!

@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 Feb 28, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 28, 2026

r? @jieyouxu

rustbot has assigned @jieyouxu.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Fallback group: @Mark-Simulacrum, @jieyouxu
  • @Mark-Simulacrum, @jieyouxu expanded to Mark-Simulacrum, jieyouxu
  • Random selection from Mark-Simulacrum, jieyouxu

@jieyouxu
Copy link
Member

r? mir-opt

@rustbot rustbot assigned wesleywiser and unassigned jieyouxu Feb 28, 2026
@rust-log-analyzer

This comment has been minimized.

Copy link
Contributor

@cjgillot cjgillot left a comment

Choose a reason for hiding this comment

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

This looks like an ancient test to mark destination propagation as a desired feature. We have a dedicated mir-opt test suite for this.

Do you mind?

  • moving this test in test/mir-opt/dest-prop directory,
  • add the following comment at the top of the file
//@ test-mir-pass: DestinationPropagation

View changes since this review

Comment on lines +10 to +11
// File checks to confirm that the array is assigned and returned
// In the mir output
Copy link
Contributor

Choose a reason for hiding this comment

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

This is clearer than the current toplevel comment. Do you mind making this the toplevel doc-comment?

Comment on lines +13 to +15
// CHECK: let mut _0: [u8; 1024];
// CHECK: _0 = [const 0_u8; 1024];
// CHECK: return;
Copy link
Contributor

Choose a reason for hiding this comment

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

I usually prefer having the checks start with a // CHECK-LABEL: fn foo( and to appear inside the corresponding function.

Copy link
Author

Choose a reason for hiding this comment

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

This has been added to the PR

@cjgillot cjgillot assigned cjgillot and unassigned wesleywiser Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants