pub fn propagate_ambiguity<I, S>(
constraint: RegionConstraint<I, S>,
) -> RegionConstraint<I, S>Expand description
Force the whole constraint to be ambiguous if it contains ambiguities which could
have caused the constraint to be false if they had been false themselves.
For example if we have 'a: 'b AND ambig it’s possible that if we had more inference
information we could have produced a better region constraint than ambig, and that
constraint may then have gone on to be false, at which point we would have 'a: 'b AND false
causing the whole constraint to be false.
If we’re not careful we can wind up returning 'a: 'b AND ambig from passing trait solver
goals and then upon rerunning wind up returning NoSolution which would be dubious :3
This is inherently conservative and this method should be called as little as possible as it
can cause us to get ambiguities instead of NoSolution (for example if 'a: 'b is false),
which can affect coherence, candidate selection, etc.
FIXME(-Zassumptions-on-binders): this method should probably be trait-solver internal as it only matters at trait solver query boundaries. We currently call it in more than just that location