Skip to content
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

Unions are not PointerLike #119708

Merged
merged 1 commit into from
Jan 8, 2024
Merged

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Jan 7, 2024

I introduced the PointerLike trait to enforce dyn* coercions only from types that share the same ABI as a pointer. On top of needing to be scalar, they also should not be unions, since CTFE chokes on scalar reads for union types.

Fixes #119695

@rustbot
Copy link
Collaborator

rustbot commented Jan 7, 2024

r? @wesleywiser

(rustbot has picked a reviewer for you, use r? to override)

@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 Jan 7, 2024
Copy link
Member

@Noratrieb Noratrieb left a comment

Choose a reason for hiding this comment

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

r=me with or without the comment change

compiler/rustc_target/src/abi/mod.rs Outdated Show resolved Hide resolved
@compiler-errors
Copy link
Member Author

@bors r=Nilstrieb rollup

@bors
Copy link
Contributor

bors commented Jan 7, 2024

📌 Commit 68bb766 has been approved by Nilstrieb

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 Jan 7, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 8, 2024
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#116129 (Rewrite `pin` module documentation to clarify usage and invariants)
 - rust-lang#119703 (Impl trait diagnostic tweaks)
 - rust-lang#119705 (Support `~const` in associated functions in trait impls)
 - rust-lang#119708 (Unions are not `PointerLike`)
 - rust-lang#119711 (Delete unused makefile in tests/ui)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 2676860 into rust-lang:master Jan 8, 2024
11 checks passed
@rustbot rustbot added this to the 1.77.0 milestone Jan 8, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 8, 2024
Rollup merge of rust-lang#119708 - compiler-errors:pointer-like, r=Nilstrieb

Unions are not `PointerLike`

I introduced the `PointerLike` trait to enforce `dyn*` coercions only from types that share the same ABI as a pointer. On top of needing to be scalar, they also should not be unions, since CTFE chokes on scalar reads for union types.

Fixes rust-lang#119695
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.

ICE with dyn* when trait is implemented for union
5 participants