Diode in positive feedback?
It looks like the intention is to provide hysteresis. For instance (and assuming that V1 and Vref have series resistance that is not shown on the OP's diagram), if V1 drops below Vref then OUT will drop to 0 volts and R1/D2 will further enhance the effect of V1 lowering below Vref. This is called hysteresis and is used to avoid a situation where V1 is hovering close to the value of Vref and causing OUT to oscillate high and low due to noise.

That is what hysteresis does - once a comparator switches it stays switched with no ambiguity.

With a diode (D2) in series with R1 and with OUT high there is NO current passing back through D2 to V1. This means that if Vref were to increase toward V1, OUT would switch low at precisely the point Vref = V1.

It's a kind of one-sided hysteresis and this is due to the diode blocking the hysteresis effect in one direction.