Skip to content

Orphanck: Reject uncovered opaque types#135910

Draft
fmease wants to merge 3 commits intorust-lang:mainfrom
fmease:orphanck-rej-uncovered-opaques
Draft

Orphanck: Reject uncovered opaque types#135910
fmease wants to merge 3 commits intorust-lang:mainfrom
fmease:orphanck-rej-uncovered-opaques

Conversation

@fmease
Copy link
Copy Markdown
Member

@fmease fmease commented Jan 23, 2025

Fixes #130978.
Fixes #136188.

TODO: Fix blocking FIXME(fmease)s.
TODO: Clean up tests.

Feel free to review already though!

r? lcnr

@fmease fmease added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` rla-silenced Silences rust-log-analyzer postings to the PR it's added on. labels Jan 23, 2025
@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 Jan 23, 2025
Comment on lines +524 to +527
// FIXME(fmease): This is a temporary HACK; rework it. In the next solver,
// we normalize structurally meaning opaque types "remain behind" weak
// aliases. I kind of want to expand_weak_alias_tys this but that's
// pretty hacky, too.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The HACK mentioned in the PR description.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah 🤔 I don't really know what to do here. I feel like ideally we potentially don't need to recompute things here and report an error using only the original uncovered type as this folder is somewhat :/

I am personally fine with slightly regressing diagnostics here if necessary for that, but don't have a clear idea of how bad this would be

@fmease fmease removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 23, 2025
ControlFlow::Break(OrphanCheckEarlyExit::LocalTy(ty))
}
} else {
// Regarding *opaque types* specifically, we choose to treat them as non-local,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We probably want to bring back some of these nicely written points.

@bors

This comment was marked as resolved.

@fmease fmease force-pushed the orphanck-rej-uncovered-opaques branch 5 times, most recently from 21c0272 to aba5f47 Compare April 5, 2025 05:18
@bors

This comment was marked as resolved.

@fmease fmease force-pushed the orphanck-rej-uncovered-opaques branch from aba5f47 to 111194c Compare December 28, 2025 23:19
@fmease fmease force-pushed the orphanck-rej-uncovered-opaques branch from 111194c to 41273fc Compare December 28, 2025 23:46
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Feb 6, 2026

☔ The latest upstream changes (presumably #152213) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` rla-silenced Silences rust-log-analyzer postings to the PR it's added on. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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

4 participants