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 2 commits into
base: master
Choose a base branch
from

Conversation

fmease
Copy link
Member

@fmease fmease commented Jan 23, 2025

Fixes #130978.

TODO: Get rid of a HACK.
TODO: Add new 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
Copy link
Contributor

bors commented Jan 27, 2025

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

if let Some(local_ty) = self.local_ty {
diag.arg("local_ty", local_ty);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

if you've changing this anyways, do you mind changing this back into non-translateable diagnostics? 🤔 it feels somewhat hard to review otherwise cc #132181

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
Development

Successfully merging this pull request may close these issues.

TAIT coherence checks don't ensure composability of crates
4 participants