Skip to content

Migrate some tests from tests/ui/issues to appropriate directories#154506

Merged
rust-bors[bot] merged 2 commits intorust-lang:mainfrom
ujjwalvishwakarma2006:migrate-transmute-tests-02
Apr 7, 2026
Merged

Migrate some tests from tests/ui/issues to appropriate directories#154506
rust-bors[bot] merged 2 commits intorust-lang:mainfrom
ujjwalvishwakarma2006:migrate-transmute-tests-02

Conversation

@ujjwalvishwakarma2006
Copy link
Copy Markdown
Contributor

@ujjwalvishwakarma2006 ujjwalvishwakarma2006 commented Mar 28, 2026

The following changes have been made in the pull request:

  • tests/ui/issues/issue-25746-bool-transmute.rstests/ui/transmute/transmute-bool-u8.rs
  • tests/ui/issues/issue-32377.{rs,stderr}tests/ui/intrinsics/transmute-phantomdata-generic-unequal-size.{rs,stderr}

The issue links have also been added at the top of each .rs file.

r? Kivooeo

@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 Mar 28, 2026
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

could you please investigate original issue, it seems like this is not transmute problem

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Could you please give a hint as to which directory it should belong to? (Or maybe just the part of the test file that indicates that the test might not be related to transmute).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd like if you do your own investigation and found root cause of problem in that code, and decide whether it's fine to stay here, should be moved somewhere else or be deleted, one of requirement for the project is independence

Copy link
Copy Markdown
Contributor Author

@ujjwalvishwakarma2006 ujjwalvishwakarma2006 Mar 30, 2026

Choose a reason for hiding this comment

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

From my perspective, the following could be potentially appropriate directories (not in priority order):

  • tests/ui/instrinsics: reason; because earlier instrinsicck was used to replace types with isize to compare sizes of two dynamically sized types.
  • tests/ui/associated-types: reason; the description mentions that

Tests focused on associated types. If the associated type is not in a trait definition, it belongs in the tests/ui/associated-inherent-types/ directory. Aspects exercised include, e.g., default associated types, overriding defaults, and type inference.

  • tests/ui/impl-traits: reason; some similar tests exist, but no transmutes are used.
  • tests/ui/layout: reason; as the memory layout of the [u8; 2] and struct Bar is different.
  • tests/ui/dst: reason; maybe because [u8; N] is dynamically sized

I am trying to figure out other potential candidates.

But as of now, transmute suits the most in my opinion, as most of the tests giving cannot transmute between different-sized types error are in the transmute directory only.

I take the just-above sentence back. Now, tests/ui/intrinsics is the most appropriate one here, imo.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

But as of now, transmute suits the most in my opinion, as most of the tests giving cannot transmute between different-sized types error are in the transmute directory only.

it's not about error message, it's about why this code originally was failing

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it means, if you see word transmute in test, it's not always have to go to transmute directory

Copy link
Copy Markdown
Contributor Author

@ujjwalvishwakarma2006 ujjwalvishwakarma2006 Apr 2, 2026

Choose a reason for hiding this comment

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

Here is my understanding of the test:

  • This test checks if we can transmute from one data type to another data type when they have different types and memory layouts.
  • It results in ICE, because earlier the compiler used to replace generic types with isize to deduce the size of the types whose size can't be deduced at compile time.

Oh, wait, it may belong to tests/ui/intrinsics. See here. This particular comment mentions the second point that I wrote above. And it's the duty of intrinsic, so it may also be a potential candidate. I have updated this in the upper comment as well.
This is the most appropriate now. (even better than transmute, imo)

@Kivooeo
Copy link
Copy Markdown
Member

Kivooeo commented Mar 28, 2026

@rustbot author

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 28, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 28, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Mar 28, 2026
@ujjwalvishwakarma2006 ujjwalvishwakarma2006 changed the title Migrate some tests from tests/ui/issues to tests/ui/transmute Migrate some tests from tests/ui/issues to appropriate directories Apr 6, 2026
@ujjwalvishwakarma2006 ujjwalvishwakarma2006 force-pushed the migrate-transmute-tests-02 branch from 5e889df to 9181351 Compare April 6, 2026 06:18
@Kivooeo
Copy link
Copy Markdown
Member

Kivooeo commented Apr 7, 2026

@bors r+ rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 7, 2026

📌 Commit 9181351 has been approved by Kivooeo

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 7, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 7, 2026
…smute-tests-02, r=Kivooeo

Migrate some tests from `tests/ui/issues` to appropriate directories

The following changes have been made in the pull request:

- `tests/ui/issues/issue-25746-bool-transmute.rs` ➝ `tests/ui/transmute/transmute-bool-u8.rs`
- `tests/ui/issues/issue-32377.{rs,stderr}` ➝ `tests/ui/intrinsics/transmute-phantomdata-generic-unequal-size.{rs,stderr}`

The issue links have also been added at the top of each `.rs` file.

r? Kivooeo
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 7, 2026
…smute-tests-02, r=Kivooeo

Migrate some tests from `tests/ui/issues` to appropriate directories

The following changes have been made in the pull request:

- `tests/ui/issues/issue-25746-bool-transmute.rs` ➝ `tests/ui/transmute/transmute-bool-u8.rs`
- `tests/ui/issues/issue-32377.{rs,stderr}` ➝ `tests/ui/intrinsics/transmute-phantomdata-generic-unequal-size.{rs,stderr}`

The issue links have also been added at the top of each `.rs` file.

r? Kivooeo
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 7, 2026
…smute-tests-02, r=Kivooeo

Migrate some tests from `tests/ui/issues` to appropriate directories

The following changes have been made in the pull request:

- `tests/ui/issues/issue-25746-bool-transmute.rs` ➝ `tests/ui/transmute/transmute-bool-u8.rs`
- `tests/ui/issues/issue-32377.{rs,stderr}` ➝ `tests/ui/intrinsics/transmute-phantomdata-generic-unequal-size.{rs,stderr}`

The issue links have also been added at the top of each `.rs` file.

r? Kivooeo
rust-bors bot pushed a commit that referenced this pull request Apr 7, 2026
…uwer

Rollup of 22 pull requests

Successful merges:

 - #150965 (Fix no results when searching for == in doc)
 - #153999 (Remove `TaggedQueryKey::def_kind`)
 - #154146 (Split out the creation of `Cycle` to a new `process_cycle` function)
 - #154147 (Do not attempt generating DllImport for extern types)
 - #154812 (Update Fira Mono License Information)
 - #154880 (bootstrap: minor improvements to download-rustc)
 - #154886 (Stabilize check-cfg suggestions for symbol)
 - #154889 (Update wasm-component-ld to 0.5.22)
 - #154928 (Fix pin docs)
 - #154942 (delegation: generate more verbose error delegation)
 - #153269 (GCI: During reachability analysis don't try to evaluate the initializer of overly generic free const items)
 - #154506 (Migrate some tests from `tests/ui/issues` to appropriate directories)
 - #154673 (Use a different name for fast try builds)
 - #154761 (coretests: add argument order regression tests for min_by/max_by/minmax_by)
 - #154795 (Add more info about where autodiff can be applied)
 - #154808 (Post-attribute ports cleanup pt. 1)
 - #154825 (constify `Step for NonZero<u*>`)
 - #154837 (library: std: motor: use OS' process::exit in abort_internal)
 - #154866 (add regression test for #146514)
 - #154922 (c-b: Export inverse hyperbolic trigonometric functions)
 - #154931 (delegation(small cleanup): remove not needed PhantomData)
 - #154950 (library: no `cfg(target_arch)` on scalable intrinsics)
@rust-bors rust-bors bot merged commit 2875d8e into rust-lang:main Apr 7, 2026
11 checks passed
rust-timer added a commit that referenced this pull request Apr 7, 2026
Rollup merge of #154506 - ujjwalvishwakarma2006:migrate-transmute-tests-02, r=Kivooeo

Migrate some tests from `tests/ui/issues` to appropriate directories

The following changes have been made in the pull request:

- `tests/ui/issues/issue-25746-bool-transmute.rs` ➝ `tests/ui/transmute/transmute-bool-u8.rs`
- `tests/ui/issues/issue-32377.{rs,stderr}` ➝ `tests/ui/intrinsics/transmute-phantomdata-generic-unequal-size.{rs,stderr}`

The issue links have also been added at the top of each `.rs` file.

r? Kivooeo
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Apr 8, 2026
…uwer

Rollup of 22 pull requests

Successful merges:

 - rust-lang/rust#150965 (Fix no results when searching for == in doc)
 - rust-lang/rust#153999 (Remove `TaggedQueryKey::def_kind`)
 - rust-lang/rust#154146 (Split out the creation of `Cycle` to a new `process_cycle` function)
 - rust-lang/rust#154147 (Do not attempt generating DllImport for extern types)
 - rust-lang/rust#154812 (Update Fira Mono License Information)
 - rust-lang/rust#154880 (bootstrap: minor improvements to download-rustc)
 - rust-lang/rust#154886 (Stabilize check-cfg suggestions for symbol)
 - rust-lang/rust#154889 (Update wasm-component-ld to 0.5.22)
 - rust-lang/rust#154928 (Fix pin docs)
 - rust-lang/rust#154942 (delegation: generate more verbose error delegation)
 - rust-lang/rust#153269 (GCI: During reachability analysis don't try to evaluate the initializer of overly generic free const items)
 - rust-lang/rust#154506 (Migrate some tests from `tests/ui/issues` to appropriate directories)
 - rust-lang/rust#154673 (Use a different name for fast try builds)
 - rust-lang/rust#154761 (coretests: add argument order regression tests for min_by/max_by/minmax_by)
 - rust-lang/rust#154795 (Add more info about where autodiff can be applied)
 - rust-lang/rust#154808 (Post-attribute ports cleanup pt. 1)
 - rust-lang/rust#154825 (constify `Step for NonZero<u*>`)
 - rust-lang/rust#154837 (library: std: motor: use OS' process::exit in abort_internal)
 - rust-lang/rust#154866 (add regression test for rust-lang/rust#146514)
 - rust-lang/rust#154922 (c-b: Export inverse hyperbolic trigonometric functions)
 - rust-lang/rust#154931 (delegation(small cleanup): remove not needed PhantomData)
 - rust-lang/rust#154950 (library: no `cfg(target_arch)` on scalable intrinsics)
@ujjwalvishwakarma2006 ujjwalvishwakarma2006 deleted the migrate-transmute-tests-02 branch April 8, 2026 12:23
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.

5 participants