-
Notifications
You must be signed in to change notification settings - Fork 0
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
nalgebra depends on incomplete guidance from env during method selection #161
Comments
fixed by adding the following code 💀 the alternative of forcing nalgebra to stop relying on this behavior seems bad, esp as we can't really future compat lint this in the old solver 🤔 diff --git a/compiler/rustc_hir_typeck/src/method/mod.rs b/compiler/rustc_hir_typeck/src/method/mod.rs
index 4008021c3a8..ceadb8a5c12 100644
--- a/compiler/rustc_hir_typeck/src/method/mod.rs
+++ b/compiler/rustc_hir_typeck/src/method/mod.rs
@@ -494,6 +494,14 @@ pub(crate) fn resolve_fully_qualified_call(
}
}
+ // HACK: TODO
+ let self_ty = {
+ let infer = self.infcx.next_ty_var(span);
+ self.demand_eqtype(span, infer, self_ty);
+ self.select_obligations_where_possible(|_| {});
+ self.resolve_vars_if_possible(infer)
+ };
+
let pick = self.probe_for_name(
probe::Mode::Path,
method_name, |
workingjubilee
added a commit
to workingjubilee/rustc
that referenced
this issue
Feb 14, 2025
…piler-errors eagerly prove WF when resolving fully qualified paths fixes rust-lang/trait-system-refactor-initiative#161. This hopefully shouldn't impact perf. I do think we need to deal with at least part of the fallout here, opening for vibes. r? `@compiler-errors`
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Feb 14, 2025
Rollup merge of rust-lang#136928 - lcnr:method-lookup-check-wf, r=compiler-errors eagerly prove WF when resolving fully qualified paths fixes rust-lang/trait-system-refactor-initiative#161. This hopefully shouldn't impact perf. I do think we need to deal with at least part of the fallout here, opening for vibes. r? ``@compiler-errors``
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the following snippet is ambig with the new solver and compiles with old
minimizing this to not depend on nalgebra results in the following
this errors with the following with the new solver
This compiles in the old solver as
Alias
expands toFoo<?x, <() as Constrain<?x>>::Assoc>
. Normalizing<() as Constrain<?x>>::Assoc
constrains?x
toT
, at which point method selection has a unique candidate.In the new solver we never try to normalize
<() as Constrain<?x>>::Assoc
, causing?x
to remain ambiguous at this point, resulting in an ambiguity error during method selection.Subtle: using
Foo
instead ofAlias
errors on stable as well, as it gets lowered toFoo<?x, ?y>
instead without using the default argument.Foo::<_>
also gets lowered toFoo<?x, ?y>
. We only use default arguments ifinfer_args
is set tofalse
during ast lowering in the lowerer. I don't understand why that is the case tbh 🤷The text was updated successfully, but these errors were encountered: