Skip to content

Fix unspecified transmute between slice types - #5440

Merged
tgross35 merged 1 commit into
rust-lang:mainfrom
GiGainfosystems:fix_unspecified_transmute
Aug 31, 2026
Merged

Fix unspecified transmute between slice types#5440
tgross35 merged 1 commit into
rust-lang:mainfrom
GiGainfosystems:fix_unspecified_transmute

Conversation

@weiznich

Copy link
Copy Markdown
Contributor

The layout of slices is currently not specified in Rust. This PR replaces a transmute between slices of different types with the equivalent pointer cast to keep all involved behaviour specified.

@rustbot

This comment has been minimized.

@weiznich
weiznich force-pushed the fix_unspecified_transmute branch from ec04665 to c8fcd3c Compare August 26, 2026 12:25
@tgross35

Copy link
Copy Markdown
Member

The change LGTM but could you file this against the main branch? That's what all PRs should target, libc-0.2 doesn't get updated until right before a release.

@weiznich
weiznich force-pushed the fix_unspecified_transmute branch from c8fcd3c to b02a6a4 Compare August 27, 2026 06:49
@rustbot

rustbot commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in an Android module

cc @maurer

Some changes occurred in a solarish module

cc @jclulow, @pfmooney

Some changes occurred in an OpenBSD module

cc @semarie

@weiznich

Copy link
Copy Markdown
Contributor Author

I rebased the PR and changed the base branch. Sorry for the noise from the bot :(

@tgross35 tgross35 left a comment

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.

Sorry for the confusion, thank you!

View changes since this review

@tgross35
tgross35 enabled auto-merge August 27, 2026 06:52
@tgross35 tgross35 added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Aug 27, 2026
@tgross35
tgross35 disabled auto-merge August 31, 2026 08:33
@tgross35
tgross35 enabled auto-merge August 31, 2026 08:33
@tgross35

Copy link
Copy Markdown
Member

I'm not sure what is going on with this, CI never started and I can't seem to rebase it. Would you be able to re-push and see if that unblocks?

@tgross35

Copy link
Copy Markdown
Member

Since this is a bit stuck,
@rustbot author

@rustbot

rustbot commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

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

The layout of slices is currently not specified in Rust. This PR
replaces a `transmute` between slices of different types with the
equivalent pointer cast to keep all involved behaviour specified.
auto-merge was automatically disabled August 31, 2026 09:57

Head branch was pushed to by a user without write access

@weiznich
weiznich force-pushed the fix_unspecified_transmute branch from b02a6a4 to 855c01d Compare August 31, 2026 09:57
@rustbot

rustbot commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@tgross35
tgross35 enabled auto-merge August 31, 2026 09:59
@weiznich

weiznich commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

@rustbot ready

Seems like github did not handle changing the base branch well

@tgross35
tgross35 added this pull request to the merge queue Aug 31, 2026
Merged via the queue into rust-lang:main with commit 86216b9 Aug 31, 2026
58 checks passed
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Sep 4, 2026
The layout of slices is currently not specified in Rust. This PR
replaces a `transmute` between slices of different types with the
equivalent pointer cast to keep all involved behaviour specified.

(backport <rust-lang#5440>)
(cherry picked from commit 86216b9)
@tgross35 tgross35 mentioned this pull request Sep 4, 2026
@tgross35 tgross35 added stable-applied This PR has been cherry-picked to libc's stable release branch and removed stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants