Rework upcasting confirmation to support upcasting to fewer projections in target bounds by compiler-errors · Pull Request #114036 · rust-lang/rust

compiler-errors

@compiler-errors compiler-errors changed the title Simplify upcasting confirmation to support fewer projections in target bounds Simplify confirmation to support upcasting to fewer projections in target bounds

Jul 25, 2023

lcnr

lcnr

@lcnr lcnr added the needs-fcp

This change is insta-stable, or significant enough to need a team FCP to proceed.

label

Jul 25, 2023

@compiler-errors compiler-errors added S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

T-types

Relevant to the types team, which will review and decide on the PR/issue.

and removed T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.

S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

labels

Jul 26, 2023

@compiler-errors compiler-errors changed the title Simplify confirmation to support upcasting to fewer projections in target bounds Rework upcasting confirmation to support upcasting to fewer projections in target bounds

Jul 26, 2023

compiler-errors

@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

Aug 4, 2023

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Aug 7, 2023
Bubble up nested goals from equation in `predicates_for_object_candidate`

This used to be needed for rust-lang#114036 (comment), but since it's no longer, I'm opening this as a separate PR. This also fixes one ICEing UI test: (`tests/ui/unboxed-closures/issue-53448.rs`)

r? `@lcnr`

github-actions bot pushed a commit to rust-lang/miri that referenced this pull request

Aug 8, 2023
Bubble up nested goals from equation in `predicates_for_object_candidate`

This used to be needed for rust-lang/rust#114036 (comment), but since it's no longer, I'm opening this as a separate PR. This also fixes one ICEing UI test: (`tests/ui/unboxed-closures/issue-53448.rs`)

r? `@lcnr`

lnicola pushed a commit to lnicola/rust-analyzer that referenced this pull request

Apr 7, 2024
Bubble up nested goals from equation in `predicates_for_object_candidate`

This used to be needed for rust-lang/rust#114036 (comment), but since it's no longer, I'm opening this as a separate PR. This also fixes one ICEing UI test: (`tests/ui/unboxed-closures/issue-53448.rs`)

r? `@lcnr`

RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request

Apr 27, 2024
Bubble up nested goals from equation in `predicates_for_object_candidate`

This used to be needed for rust-lang/rust#114036 (comment), but since it's no longer, I'm opening this as a separate PR. This also fixes one ICEing UI test: (`tests/ui/unboxed-closures/issue-53448.rs`)

r? `@lcnr`

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Apr 7, 2025
…l-with-proj, r=oli-obk

Fix trait upcasting to dyn type with no principal when there are projections

rust-lang#126660 (which I had originally authored, lol) had a subtle bug that is the moral equivalent of rust-lang#114036, which is that when upcasting from `dyn Principal<Projection = Ty> + AutoTrait` to `dyn AutoTrait`, we were dropping the trait ref for `Principal` but not its projections (if there were any).

With debug assertions enabled, this triggers the assertion I luckily added in a2a0cfe, but even without debug assertions this is a logical bug since we had a dyn type with just a projection bound but no principal, so it caused a type mismatch.

This does not need an FCP because this should've been covered by the FCP in rust-lang#126660, but we just weren't testing a case when casting from a `dyn` type with projections 😸

Fixes rust-lang#139418

r? `@oli-obk` (or anyone)

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Apr 7, 2025
…l-with-proj, r=oli-obk

Fix trait upcasting to dyn type with no principal when there are projections

rust-lang#126660 (which I had originally authored, lol) had a subtle bug that is the moral equivalent of rust-lang#114036, which is that when upcasting from `dyn Principal<Projection = Ty> + AutoTrait` to `dyn AutoTrait`, we were dropping the trait ref for `Principal` but not its projections (if there were any).

With debug assertions enabled, this triggers the assertion I luckily added in a2a0cfe, but even without debug assertions this is a logical bug since we had a dyn type with just a projection bound but no principal, so it caused a type mismatch.

This does not need an FCP because this should've been covered by the FCP in rust-lang#126660, but we just weren't testing a case when casting from a `dyn` type with projections 😸

Fixes rust-lang#139418

r? ``@oli-obk`` (or anyone)

Zalathar added a commit to Zalathar/rust that referenced this pull request

Apr 8, 2025
…l-with-proj, r=oli-obk

Fix trait upcasting to dyn type with no principal when there are projections

rust-lang#126660 (which I had originally authored, lol) had a subtle bug that is the moral equivalent of rust-lang#114036, which is that when upcasting from `dyn Principal<Projection = Ty> + AutoTrait` to `dyn AutoTrait`, we were dropping the trait ref for `Principal` but not its projections (if there were any).

With debug assertions enabled, this triggers the assertion I luckily added in a2a0cfe, but even without debug assertions this is a logical bug since we had a dyn type with just a projection bound but no principal, so it caused a type mismatch.

This does not need an FCP because this should've been covered by the FCP in rust-lang#126660, but we just weren't testing a case when casting from a `dyn` type with projections 😸

Fixes rust-lang#139418

r? ```@oli-obk``` (or anyone)

Zalathar added a commit to Zalathar/rust that referenced this pull request

Apr 8, 2025
…l-with-proj, r=oli-obk

Fix trait upcasting to dyn type with no principal when there are projections

rust-lang#126660 (which I had originally authored, lol) had a subtle bug that is the moral equivalent of rust-lang#114036, which is that when upcasting from `dyn Principal<Projection = Ty> + AutoTrait` to `dyn AutoTrait`, we were dropping the trait ref for `Principal` but not its projections (if there were any).

With debug assertions enabled, this triggers the assertion I luckily added in a2a0cfe, but even without debug assertions this is a logical bug since we had a dyn type with just a projection bound but no principal, so it caused a type mismatch.

This does not need an FCP because this should've been covered by the FCP in rust-lang#126660, but we just weren't testing a case when casting from a `dyn` type with projections 😸

Fixes rust-lang#139418

r? ````@oli-obk```` (or anyone)

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Apr 8, 2025
Rollup merge of rust-lang#139421 - compiler-errors:upcast-no-principal-with-proj, r=oli-obk

Fix trait upcasting to dyn type with no principal when there are projections

rust-lang#126660 (which I had originally authored, lol) had a subtle bug that is the moral equivalent of rust-lang#114036, which is that when upcasting from `dyn Principal<Projection = Ty> + AutoTrait` to `dyn AutoTrait`, we were dropping the trait ref for `Principal` but not its projections (if there were any).

With debug assertions enabled, this triggers the assertion I luckily added in a2a0cfe, but even without debug assertions this is a logical bug since we had a dyn type with just a projection bound but no principal, so it caused a type mismatch.

This does not need an FCP because this should've been covered by the FCP in rust-lang#126660, but we just weren't testing a case when casting from a `dyn` type with projections 😸

Fixes rust-lang#139418

r? ````@oli-obk```` (or anyone)