Skip to content

interpret: fix TypeId pointers being considered data pointers #144169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 20, 2025

Conversation

RalfJung
Copy link
Member

@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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 19, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 19, 2025

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

The Miri subtree was changed

cc @rust-lang/miri

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

@@ -783,7 +783,7 @@ impl TypeId {

// This is a provenance-stripping memcpy.
for (i, chunk) in self.data.iter().copied().enumerate() {
let chunk = chunk.expose_provenance().to_ne_bytes();
let chunk = chunk.addr().to_ne_bytes();
Copy link
Member Author

Choose a reason for hiding this comment

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

This change is not required, but since we want to strip the provenance anyway there's no reason to expose it.

@oli-obk
Copy link
Contributor

oli-obk commented Jul 19, 2025

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jul 19, 2025

📌 Commit 7672e4e has been approved by oli-obk

It is now in the queue for this repository.

@bors bors 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-review Status: Awaiting review from the assignee but also interested parties. labels Jul 19, 2025
Kobzol added a commit to Kobzol/rust that referenced this pull request Jul 19, 2025
interpret: fix TypeId pointers being considered data pointers

Fixes rust-lang/miri#4477
r? `@oli-obk`
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 20, 2025
interpret: fix TypeId pointers being considered data pointers

Fixes rust-lang/miri#4477
r? ``@oli-obk``
fee1-dead added a commit to fee1-dead-contrib/rust that referenced this pull request Jul 20, 2025
interpret: fix TypeId pointers being considered data pointers

Fixes rust-lang/miri#4477
r? ```@oli-obk```
bors added a commit that referenced this pull request Jul 20, 2025
Rollup of 12 pull requests

Successful merges:

 - #141260 (Allow volatile access to non-Rust memory, including address 0)
 - #143604 (Stabilize `const_float_round_methods`)
 - #143833 (Ban projecting into SIMD types [MCP838])
 - #143988 ([rustdoc] Make aliases search support partial matching)
 - #144078 (Fix debuginfo-lto-alloc.rs test)
 - #144111 (Remove deprecated `MaybeUninit` slice methods)
 - #144116 (Fixes for LLVM 21)
 - #144134 (Cleanup unicode table gen)
 - #144142 (Add implicit sized bound to trait ascription types)
 - #144148 (Remove pretty print hack for async blocks)
 - #144169 (interpret: fix TypeId pointers being considered data pointers)
 - #144196 (Initialize mingw for the runner's user)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Jul 20, 2025
Rollup of 11 pull requests

Successful merges:

 - #141260 (Allow volatile access to non-Rust memory, including address 0)
 - #143604 (Stabilize `const_float_round_methods`)
 - #143988 ([rustdoc] Make aliases search support partial matching)
 - #144078 (Fix debuginfo-lto-alloc.rs test)
 - #144111 (Remove deprecated `MaybeUninit` slice methods)
 - #144116 (Fixes for LLVM 21)
 - #144134 (Cleanup unicode table gen)
 - #144142 (Add implicit sized bound to trait ascription types)
 - #144148 (Remove pretty print hack for async blocks)
 - #144169 (interpret: fix TypeId pointers being considered data pointers)
 - #144196 (Initialize mingw for the runner's user)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 72588c8 into rust-lang:master Jul 20, 2025
11 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 20, 2025
rust-timer added a commit that referenced this pull request Jul 20, 2025
Rollup merge of #144169 - RalfJung:type-id-fix, r=oli-obk

interpret: fix TypeId pointers being considered data pointers

Fixes rust-lang/miri#4477
r? ````@oli-obk````
@RalfJung RalfJung deleted the type-id-fix branch July 20, 2025 20:34
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Jul 21, 2025
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#141260 (Allow volatile access to non-Rust memory, including address 0)
 - rust-lang/rust#143604 (Stabilize `const_float_round_methods`)
 - rust-lang/rust#143988 ([rustdoc] Make aliases search support partial matching)
 - rust-lang/rust#144078 (Fix debuginfo-lto-alloc.rs test)
 - rust-lang/rust#144111 (Remove deprecated `MaybeUninit` slice methods)
 - rust-lang/rust#144116 (Fixes for LLVM 21)
 - rust-lang/rust#144134 (Cleanup unicode table gen)
 - rust-lang/rust#144142 (Add implicit sized bound to trait ascription types)
 - rust-lang/rust#144148 (Remove pretty print hack for async blocks)
 - rust-lang/rust#144169 (interpret: fix TypeId pointers being considered data pointers)
 - rust-lang/rust#144196 (Initialize mingw for the runner's user)

r? `@ghost`
`@rustbot` modify labels: rollup
Muscraft pushed a commit to Muscraft/rust that referenced this pull request Jul 21, 2025
interpret: fix TypeId pointers being considered data pointers

Fixes rust-lang/miri#4477
r? ````@oli-obk````
Muscraft pushed a commit to Muscraft/rust that referenced this pull request Jul 21, 2025
…iaskrgr

Rollup of 11 pull requests

Successful merges:

 - rust-lang#141260 (Allow volatile access to non-Rust memory, including address 0)
 - rust-lang#143604 (Stabilize `const_float_round_methods`)
 - rust-lang#143988 ([rustdoc] Make aliases search support partial matching)
 - rust-lang#144078 (Fix debuginfo-lto-alloc.rs test)
 - rust-lang#144111 (Remove deprecated `MaybeUninit` slice methods)
 - rust-lang#144116 (Fixes for LLVM 21)
 - rust-lang#144134 (Cleanup unicode table gen)
 - rust-lang#144142 (Add implicit sized bound to trait ascription types)
 - rust-lang#144148 (Remove pretty print hack for async blocks)
 - rust-lang#144169 (interpret: fix TypeId pointers being considered data pointers)
 - rust-lang#144196 (Initialize mingw for the runner's user)

r? `@ghost`
`@rustbot` modify labels: rollup
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. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

std::fmt::Debug for TypeId triggers false positive UB warning
4 participants