Allow constraining opaque types during subtyping in the trait system by oli-obk · Pull Request #125447 · rust-lang/rust (original) (raw)

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

oli-obk

Previous attempt: #123979

Sometimes we don't immediately perform subtyping, but instead register a subtyping obligation and solve that obligation when its inference variables become resolved. Unlike immediate subtyping, we currently do not allow registering hidden types for opaque types. This PR also allows that.

@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

May 23, 2024

@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added A-testsuite

Area: The testsuite used to check the correctness of rustc

T-bootstrap

Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

labels

May 23, 2024

@rustbot

This comment was marked as resolved.

@rust-log-analyzer

This comment has been minimized.

@compiler-errors

This comment was marked as resolved.

oli-obk

oli-obk

@oli-obk

This comment was marked as resolved.

@compiler-errors

This comment was marked as resolved.

@oli-obk

This comment was marked as resolved.

@lcnr

A minimized test:

fn foo() -> impl Default { let x = Default::default(); // add Subtype(?x, ?y) obligation let y = x;

// Make a tuple `(?x, ?y)` and equate it with `(impl Default, u32)`.
// For us to try and prove a `Subtype(impl Default, u32)` obligation,
// we have to instantiate both `?x` and `?y` without any
// `select_where_possible` calls inbetween.
let tup = &mut (x, y);
let assign_tup = &mut (foo(), 1u32);
tup = assign_tup;
1u32

}

fn main() {}

I think this change is clearly desirable, even if it did no go through an FCP. From what I can tell it also doesn't block any other work, as I want us to convert all places to use DefineOpaqueTypes::Yes before stabilizing ATPIT. I would like us to FCP this.

While I think it would have been fine to FCP merge this without first reverting this PR, we would only have 1 week to go through the FCP to make it in time for its stabilization. Given that we're missing some existing uncertainty wrt the impact of this change, please revert #123979 and remerge it after a types FCP.

@oli-obk

This comment was marked as resolved.

@bors

This comment was marked as resolved.

@oli-obk oli-obk changed the titleRemove assertion now that we have a test covering the code path Allow constraining opaque types during subtyping in the trait system

May 27, 2024

@rustbot

This comment was marked as resolved.

@rustbot

This comment was marked as resolved.

@rustbot rustbot added the S-waiting-on-author

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

label

May 27, 2024

@oli-obk oli-obk added 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.

T-bootstrap

Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

labels

May 27, 2024

compiler-errors

@compiler-errors

@bors

📌 Commit 1e9cd07 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

Jun 18, 2024

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

Jun 19, 2024

@jieyouxu

…-errors

Allow constraining opaque types during subtyping in the trait system

Previous attempt: rust-lang#123979

Sometimes we don't immediately perform subtyping, but instead register a subtyping obligation and solve that obligation when its inference variables become resolved. Unlike immediate subtyping, we currently do not allow registering hidden types for opaque types. This PR also allows that.

@jieyouxu

@bors bors added S-waiting-on-author

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

and removed S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

labels

Jun 19, 2024

@oli-obk

@oli-obk

@bors

📌 Commit ba4510e 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-author

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

labels

Jun 19, 2024

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

Jun 19, 2024

@bors

Rollup of 6 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

@bors

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

Jun 19, 2024

@rust-timer

Rollup merge of rust-lang#125447 - oli-obk:eq_opaque_pred, r=compiler-errors

Allow constraining opaque types during subtyping in the trait system

Previous attempt: rust-lang#123979

Sometimes we don't immediately perform subtyping, but instead register a subtyping obligation and solve that obligation when its inference variables become resolved. Unlike immediate subtyping, we currently do not allow registering hidden types for opaque types. This PR also allows that.

@fmease

It's already merged, bors. What the hell?
@bors r-

Edit: We currently have three full-build pending PRs, omg.

@fmease

@bors bors added S-waiting-on-author

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

and removed S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

labels

Jun 19, 2024

tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request

Sep 11, 2024

@tmeijn

This MR contains the following updates:

Package Update Change
rust minor 1.80.1 -> 1.81.0

MR created with the help of el-capitano/tools/renovate-bot.

Proposed changes to behavior should be submitted there as MRs.


Release Notes

rust-lang/rust (rust)

v1.81.0

Compare Source

==========================

Language

Compiler

Libraries

Stabilized APIs

These APIs are now stable in const contexts:

Cargo

Compatibility Notes

Internal Changes

These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this MR and you won't be reminded about this update again.



This MR has been generated by Renovate Bot.

wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this pull request

Sep 22, 2024

@he32

Pkgsrc changes:

Upstream changes:

Version 1.81.0 (2024-09-05)

Language

Compiler

Libraries

Stabilized APIs

These APIs are now stable in const contexts:

Cargo

Compatibility Notes

Internal Changes

These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request

Nov 24, 2024

@he32

Pkgsrc changes:

Upstream changes:

Version 1.81.0 (2024-09-05)

Language

Compiler

Libraries

Stabilized APIs

These APIs are now stable in const contexts:

Cargo

Compatibility Notes

Internal Changes

These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.

Labels

A-testsuite

Area: The testsuite used to check the correctness of rustc

disposition-merge

This issue / PR is in PFCP or FCP with a disposition to merge it.

finished-final-comment-period

The final comment period is finished for this PR / Issue.

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.