Skip to content

Conversation

@qmwrygdxpzc
Copy link

@qmwrygdxpzc qmwrygdxpzc commented Oct 24, 2025

Fixes #1966.

Now the program checks for transmutting from a struct containing a
single raw pointer to a reference.

struct Foo(*const i32);
fn foo(foo: Foo) -> &i32 {
    unsafe { transmute(foo) }
}

changelog: [transmute_ptr_to_ref]: now checks for a pointer wrapped in
a struct

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 24, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 24, 2025

r? @Alexendoo

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

This comment has been minimized.

@qmwrygdxpzc qmwrygdxpzc force-pushed the transmute-struct branch 2 times, most recently from 90872c2 to 7521b6e Compare October 24, 2025 22:27
ceptontech added 2 commits October 27, 2025 09:25
Now the program checks for transmutting from a struct containing a
single raw pointer to a reference.

```Rust
struct Foo(*const i32);
fn foo(foo: Foo) -> &i32 {
    unsafe { transmute(foo) }
}
```

changelog: [`transmute_ptr_to_ref`]: now checks for a pointer wrapped in
a struct
Now the program checks for transmutting from a struct containing a
single raw pointer to a raw pointer.

changelog: [`transmute_ptr_to_ptr`]: now checks for a pointer wrapped in
a struct
@rustbot
Copy link
Collaborator

rustbot commented Oct 27, 2025

This PR was rebased onto a different master 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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

extend transmute_ptr_to_ref to detect transmuting newtypes around ptrs

4 participants