-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
finish trait solver skeleton work #106718
Conversation
Some changes occurred to the core trait solver |
☔ The latest upstream changes (presumably #106742) made this pull request unmergeable. Please resolve the merge conflicts. |
This comment has been minimized.
This comment has been minimized.
b003e9c
to
6a1912b
Compare
This comment has been minimized.
This comment has been minimized.
4fa544e
to
98700cf
Compare
@bors r+ |
📌 Commit 98700cf481bce946bff316b56836cfffd885127b has been approved by It is now in the queue for this repository. |
@@ -19,6 +19,7 @@ rustc_infer = { path = "../rustc_infer" } | |||
rustc_lint_defs = { path = "../rustc_lint_defs" } | |||
rustc_macros = { path = "../rustc_macros" } | |||
rustc_query_system = { path = "../rustc_query_system" } | |||
rustc_serialize = { path = "../rustc_serialize" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not blocking, but but what's this crate dependency for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for rustc_index::newtype_index!
☔ The latest upstream changes (presumably #106998) made this pull request unmergeable. Please resolve the merge conflicts. |
@bors r=compiler-errors rollup=always |
This comment was marked as off-topic.
This comment was marked as off-topic.
Rollup of 5 pull requests Successful merges: - rust-lang#103702 (Lift `T: Sized` bounds from some `strict_provenance` pointer methods) - rust-lang#106441 (relax reference requirement on SocketAddrExt::from_abstract_name) - rust-lang#106718 (finish trait solver skeleton work) - rust-lang#106950 (Don't do pointer arithmetic on pointers to deallocated memory) - rust-lang#107014 (rustdoc: remove deprecated / unused code from main.js) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
|
||
impl<'tcx> EvalCtxt<'_, 'tcx> { | ||
pub(super) fn compute_projection_goal( | ||
&mut self, | ||
goal: Goal<'tcx, ProjectionPredicate<'tcx>>, | ||
) -> QueryResult<'tcx> { | ||
let candidates = self.assemble_and_evaluate_candidates(goal); | ||
self.merge_project_candidates(candidates) | ||
// To only compute normalization ones for each projection we only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"to only compute ones", fixme: once
.
☔ The latest upstream changes (presumably #107026) made this pull request unmergeable. Please resolve the merge conflicts. |
…didates-2, r=lcnr Implement some candidates for the new solver (redux) Based on rust-lang#106718, so the diff is hard to read without it. See [here](rust-lang/rust@98700cf...compiler-errors:rust:new-solver-new-candidates-2) for an easier view until that one lands. Of note: * 44af916020fb43c12070125c45b6dee4ec303bbc fixes a bug where we need to make the query response *inside* of a probe, or else we make no inference progress (I think) * 50daad5acd2f163d03e7ffab942534f09bc36e2e implements `consider_assumption` for traits and predicates. I'm not sure if using `sup` here is necessary or if `eq` is fine. * We decided that all of the `instantiate_constituent_tys_for_*` functions are verbose but ok, since they need to be exhaustive and the logic between each of them is not similar enough, right? r? `@lcnr`
…didates-2, r=lcnr Implement some candidates for the new solver (redux) Based on rust-lang#106718, so the diff is hard to read without it. See [here](rust-lang/rust@98700cf...compiler-errors:rust:new-solver-new-candidates-2) for an easier view until that one lands. Of note: * 44af916020fb43c12070125c45b6dee4ec303bbc fixes a bug where we need to make the query response *inside* of a probe, or else we make no inference progress (I think) * 50daad5acd2f163d03e7ffab942534f09bc36e2e implements `consider_assumption` for traits and predicates. I'm not sure if using `sup` here is necessary or if `eq` is fine. * We decided that all of the `instantiate_constituent_tys_for_*` functions are verbose but ok, since they need to be exhaustive and the logic between each of them is not similar enough, right? r? ``@lcnr``
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
648d661b4e0fcf55f7082894f577377eb451db4b
The previous implementation didn't remove provisional entries which depended on the current goal if we're forced to rerun in case the provisional result of that entry is different from the new result. For reference, see https://rust-lang.github.io/chalk/book/recursive/search_graph.html.
We should also treat inductive cycles as overflow, not ordinary ambiguity.
219a5de2517cebfe20a2c3417bd302f7c12db70c 6a1912be539dd5a3b3c10be669787c4bf0c1868a
These two commits move canonicalization to the start of the queries which simplifies a bunch of stuff. I originally intended to keep stuff canonicalized for a while because I expected us to add a additional caches the trait solver, either for candidate assembly or for projections. We ended up not adding (and expect to not need) any of them so this just ends up being easier to understand.
d78d5ad0979e965afde6500bccfa119b47063506
adds a special
eq
for the solver which doesn't care about obligations or spans18704e6a78b7703e1bbb3856f015cb76c0a07a06
implements https://rust-lang.zulipchat.com/#narrow/stream/364551-t-types.2Ftrait-system-refactor/topic/projection.20cache
r? @compiler-errors