Conversation
This comment has been minimized.
This comment has been minimized.
3564a3f to
755953f
Compare
This comment has been minimized.
This comment has been minimized.
see the added test
755953f to
a4564e7
Compare
FindParamInClause global on overflowFindParamInClause handle edge-cases
|
|
|
r? BoxyUwU |
|
Requested reviewer is already assigned to this pull request. Please choose another assignee. |
| TypeFlags::HAS_PLACEHOLDER | TypeFlags::HAS_INFER | TypeFlags::HAS_ALIAS, | ||
| ) => | ||
| { | ||
| ct.super_visit_with(self) |
There was a problem hiding this comment.
why the not doing recursion depth stuff here 🤔
There was a problem hiding this comment.
existing xd :3 because the only way constants recurse is through types atm
There was a problem hiding this comment.
I guess this has to change with mgca
There was a problem hiding this comment.
up to u if u want to handle it in this PR, it'd be a fairly reasonable FIXME(mgca) to get some new-ish contributor to work on as onboarding
| })); | ||
| ty::Infer(_) => ControlFlow::Break(Ok(Certainty::AMBIGUOUS)), | ||
| _ if ty.has_type_flags( | ||
| TypeFlags::HAS_PLACEHOLDER | TypeFlags::HAS_INFER | TypeFlags::HAS_ALIAS, |
There was a problem hiding this comment.
so there are two meaningful changes here:
- we now recurse if there are aliases
- we now recurse if there are non-region-infers
recursing if there are aliases makes sense (that's certainly the point of this PR) but I don't fully understand why we care about infer vars or not.
There was a problem hiding this comment.
to treat ambiguous normalization as Global. You could imagine normalizing T::Assoc to Vec<T::AmbiguousAlias> which ends up as Vec<?infer>
I guess we could always force GLobal if there are infer vars instead of recursing
There was a problem hiding this comment.
do we have a test with ambiguous aliases? I guess you could only really get ambiguity here via overflow (are opaque types relevant?)?
If normalization is ambiguous, we want to treat the where-bound as non-global. The affected code should pretty much always have other errors in that case. It does make reasoning about trait solver cycles and rerunning more confusing and just feels wrong ™️ I encountered this while looking into
ml-kem(rust-lang/trait-system-refactor-initiative#246). I don't know whether this matters in practice and don't care to look into it too deeply.We also want to properly handle concrete aliases which mention to something mentioning a generic parameter due to another where-bound.
r? @BoxyUwU