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

Allow dropping dyn principal #131857

Merged
merged 2 commits into from
Oct 18, 2024
Merged

Conversation

WaffleLapkin
Copy link
Member

Revival of #126660, which was a revival of #114679. Fixes #126313.

Allows dropping principal when coercing trait objects, e.g. dyn Debug + Send -> dyn Send.

cc @compiler-errors @Jules-Bertholet
r? @lcnr

@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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Oct 17, 2024
@rustbot
Copy link
Collaborator

rustbot commented Oct 17, 2024

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

The Miri subtree was changed

cc @rust-lang/miri


impl<T: Send + Sync> Bar for T {}

const fn yeet_principal_2(x: Box<dyn Bar>) -> Box<dyn Send> {
Copy link
Member

Choose a reason for hiding this comment

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

yay thanks for testing this one specifically :3

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 was actually @Jules-Bertholet :D
I only added a dyn* test as asked by lcnr.

Copy link
Member

Choose a reason for hiding this comment

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

ty jules :3

@compiler-errors
Copy link
Member

r=me after ci passes, unless you want a review from lcnr specifically

@WaffleLapkin
Copy link
Member Author

@bors r=compiler-errors

@bors
Copy link
Contributor

bors commented Oct 18, 2024

📌 Commit c4bce0b has been approved by compiler-errors

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

Rollup of 5 pull requests

Successful merges:

 - rust-lang#131654 (Various fixes for Xous)
 - rust-lang#131743 (rustc_metadata: minor tidying)
 - rust-lang#131823 (Bump libc to 0.2.161)
 - rust-lang#131850 (Missing parenthesis)
 - rust-lang#131857 (Allow dropping dyn principal)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 13b3984 into rust-lang:master Oct 18, 2024
6 checks passed
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Oct 18, 2024
Rollup merge of rust-lang#131857 - WaffleLapkin:dyn-drop-principal-3, r=compiler-errors

Allow dropping dyn principal

Revival of rust-lang#126660, which was a revival of rust-lang#114679. Fixes rust-lang#126313.

Allows dropping principal when coercing trait objects, e.g. `dyn Debug + Send` -> `dyn Send`.

cc `@compiler-errors` `@Jules-Bertholet`
r? `@lcnr`
@rustbot rustbot added this to the 1.84.0 milestone Oct 18, 2024
@WaffleLapkin WaffleLapkin deleted the dyn-drop-principal-3 branch October 18, 2024 09:55
@lcnr lcnr added the relnotes Marks issues that should be documented in the release notes of the next release. label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release. 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

trait Trait: Send: upcasting from dyn Trait to dyn Send does not work
6 participants