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

Orphanck: Reject uncovered opaque types #135910

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

fmease
Copy link
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
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
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
}
} else {
// Regarding *opaque types* specifically, we choose to treat them as non-local,
Copy link
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 4 times, most recently from 414a046 to 21c0272 Compare April 4, 2025 16:25
@fmease fmease force-pushed the orphanck-rej-uncovered-opaques branch from 21c0272 to aba5f47 Compare April 5, 2025 05:18
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