Skip to content

Conversation

@mattiapitossi
Copy link
Contributor

Motivation

I noticed that there are a couple of unsafe impl of the pointer's addr method in the code. Was wondering if we want to replace with addr since it's stable from v1.84.

Solution

Replace unsafe { std::mem::transmute(ptr) }; with <ptr>::addr method.

@ADD-SP ADD-SP added C-maintenance Category: PRs that clean code up or issues documenting cleanup. A-tokio Area: The main tokio crate labels Nov 8, 2025
Copy link
Member

@ADD-SP ADD-SP left a comment

Choose a reason for hiding this comment

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

@ADD-SP ADD-SP added the S-waiting-on-author Status: awaiting some action (such as code changes) from the PR or issue author. label Nov 8, 2025
@mattiapitossi
Copy link
Contributor Author

mattiapitossi commented Nov 8, 2025

Hi @ADD-SP, it looks like that the -Zmiri-strict-provenance flag prevents to use with_exposed_provenance API. I reverted the commit (see: https://github.com/tokio-rs/tokio/actions/runs/19196647091/job/54878644730)

@Darksonn
Copy link
Contributor

Darksonn commented Nov 8, 2025

The entire point of this file is to avoid using expose_provenance so that Tokio can run with -Zmiri-strict-provenance. So we should not switch to expose_provenance.

Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

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

Thanks.

@Darksonn Darksonn merged commit d4641ba into tokio-rs:master Nov 8, 2025
88 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-tokio Area: The main tokio crate C-maintenance Category: PRs that clean code up or issues documenting cleanup. S-waiting-on-author Status: awaiting some action (such as code changes) from the PR or issue author.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants