Repository navigation
Conversation
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Amirhossein Akhlaghpour <m9.akhlaghpoor@gmail.com>
c29ef89 to
e8381f1
Compare
|
HIR ty lowering was modified cc @fmease |
|
rustbot has assigned @petrochenkov. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
r? lcnr |
Signed-off-by: Amirhossein Akhlaghpour <m9.akhlaghpoor@gmail.com>
|
Reworked this to avoid using type relations in ItemCtxt |
| } | ||
|
|
||
| ty::DeepRejectCtxt::relate_rigid_infer(tcx) | ||
| .types_may_unify_with_depth(value, impl_ty, usize::MAX) |
There was a problem hiding this comment.
hmm, this is a lot of complexity for a kind of minor diagnostic. But also, this code is weird. why do you both have an infcx.is_none() check and then do an if let. feels nicer to only match on infcx once. We never have infcx and not a param_env, do we? so maybe we should have a single get_ctxt_if_in_body or something that returns both InferCtxt and ParamEnv
fold_regions to replace all regions with erased is wrong. We must not replace bound regions as doing so changes types.
I feel like ideally we wouldn't try to do anything interesting when in an ItemCtxt 🤔 idk what I want here. How bad is it if you always just use the deepreject check and never try a proper can_eq?
There was a problem hiding this comment.
I think using DeepRejectCtxt everywhere makes sense here
we might get some false positives, like (u8, u16) matching impl<T> HasItem for (T, T) but that seems acceptable for a diagnostic
we'd need to reconsider MachineApplicable though
I'll simplify the code
There was a problem hiding this comment.
I noticed that DeepRejectCtxt matches unresolved projections against quite a few unrelated impls
may skipping them also loses some useful suggestions in function bodies but I think that is better than suggesting traits that do not actually apply
Signed-off-by: Amirhossein Akhlaghpour <m9.akhlaghpoor@gmail.com>
f666945 to
b3eee23
Compare
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Amirhossein Akhlaghpour <m9.akhlaghpoor@gmail.com>
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Amirhossein Akhlaghpour <m9.akhlaghpoor@gmail.com>
|
☔ The latest upstream changes (presumably #165234) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
fixes #163320
the associated type suggestion probe uses an empty param-env which leaves the next solver without the const parameter's type information
we can add necessary clauses while avoiding queries for a generic parameter's type during its own lowering