-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Do not try to reveal hidden types when trying to prove auto-traits in the defining scope #122192
Do not try to reveal hidden types when trying to prove auto-traits in the defining scope #122192
Conversation
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
Reassigning reviewer because it allows more code on stable and needs trait system reviews |
happy with this change in general, unless this blocks the stabilization of ATPIT I would wait until #122077 is merged for an in-depth review |
This PR is low priority and deserves some mir_const_qualifs cleanups and reduplications before landing anyway. The other two PRs this one is based on are needed for ATPIT |
69500f9
to
8de5565
Compare
I would like to make more code compile by avoiding unnecessary (and false) query cycles in const fn f() -> impl Eq {
g()
}
const fn g() {} The reason is that when checking whether the return type implements @rfcbot merge |
Team member @oli-obk has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
As a quick note: this differs from the new solver in that the new solver instead normalizes the opaque type by looking at the opaque type storage, so the new solver may instead return ambiguity or success instead of Theoretically the incompleteness of the old solver may guide type inference, but as there are no trait implementations with @rfcbot reviewed |
Rollup of 7 pull requests Successful merges: - rust-lang#122192 (Do not try to reveal hidden types when trying to prove Freeze in the defining scope) - rust-lang#124840 (resolve: mark it undetermined if single import is not has any bindings) - rust-lang#125622 (Winnow private method candidates instead of assuming any candidate of the right name will apply) - rust-lang#125871 (Orphanck[old solver]: Consider opaque types to never cover type parameters) - rust-lang#125893 (Handle all GVN binops in a single place.) - rust-lang#125911 (delete bootstrap build before switching to bumped rustc) - rust-lang#125918 (Revert: create const block bodies in typeck via query feeding) r? `@ghost` `@rustbot` modify labels: rollup
…ound_yay, r=<try> Do not use global cache for selection candidates if opaque types can be constrained fixes rust-lang#105787 r? `@ghost` This is certainly the crudest way to make the cache sound wrt opaque types, but if perf lets us get away with this, let's do it in the old solver and let the new solver fix this correctly once and for all. If perf is prohibitively bad, I'll look into alternatives (using canonical queries, checking whether any opaque types got constrained or whether decisions based on the availability of opaque types were made, still using the cache for things that can't possibly constrain opaque types (probably sound, famous last words), ..) cc rust-lang#122192 (comment) * [ ] check if this actually fixes rust-lang#105787 or if it just fixes the opaque type reproducer
☔ The latest upstream changes (presumably #126838) made this pull request unmergeable. Please resolve the merge conflicts. |
ad6e85b
to
dd96364
Compare
This comment has been minimized.
This comment has been minimized.
dd96364
to
10930de
Compare
…ound_yay, r=lcnr Do not use global caches if opaque types can be defined fixes rust-lang#119272 r? `@lcnr` This is certainly a crude way to make the cache sound wrt opaque types, but since perf lets us get away with this, let's do it in the old solver and let the new solver fix this correctly once and for all. cc rust-lang#122192 (comment)
…ound_yay, r=lcnr Do not use global caches if opaque types can be defined fixes rust-lang#119272 r? `@lcnr` This is certainly a crude way to make the cache sound wrt opaque types, but since perf lets us get away with this, let's do it in the old solver and let the new solver fix this correctly once and for all. cc rust-lang#122192 (comment)
…ound_yay, r=lcnr Do not use global caches if opaque types can be defined fixes rust-lang#119272 r? `@lcnr` This is certainly a crude way to make the cache sound wrt opaque types, but since perf lets us get away with this, let's do it in the old solver and let the new solver fix this correctly once and for all. cc rust-lang#122192 (comment)
…ound_yay, r=lcnr Do not use global caches if opaque types can be defined fixes rust-lang#119272 r? `@lcnr` This is certainly a crude way to make the cache sound wrt opaque types, but since perf lets us get away with this, let's do it in the old solver and let the new solver fix this correctly once and for all. cc rust-lang#122192 (comment)
…ound_yay, r=lcnr Do not use global caches if opaque types can be defined fixes rust-lang#119272 r? `@lcnr` This is certainly a crude way to make the cache sound wrt opaque types, but since perf lets us get away with this, let's do it in the old solver and let the new solver fix this correctly once and for all. cc rust-lang#122192 (comment)
☔ The latest upstream changes (presumably #126024) made this pull request unmergeable. Please resolve the merge conflicts. |
10930de
to
232d370
Compare
232d370
to
8ea461d
Compare
@bors r=lcnr |
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#122192 (Do not try to reveal hidden types when trying to prove auto-traits in the defining scope) - rust-lang#126042 (Implement `unsigned_signed_diff`) - rust-lang#126548 (Improved clarity of documentation for std::fs::create_dir_all) - rust-lang#127717 (Fix malformed suggestion for repeated maybe unsized bounds) - rust-lang#128046 (Fix some `#[cfg_attr(not(doc), repr(..))]`) - rust-lang#128122 (Mark `missing_fragment_specifier` as `FutureReleaseErrorReportInDeps`) - rust-lang#128135 (std: use duplicate thread local state in tests) - rust-lang#128140 (Remove Unnecessary `.as_str()` Conversions) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#122192 - oli-obk:type_of_opaque_for_const_checks, r=lcnr Do not try to reveal hidden types when trying to prove auto-traits in the defining scope fixes rust-lang#99793 this avoids the cycle error by just causing a selection error, which is not fatal. We pessimistically assume that freeze does not hold, which is always a safe assumption.
fixes #99793
this avoids the cycle error by just causing a selection error, which is not fatal. We pessimistically assume that freeze does not hold, which is always a safe assumption.