Xanathar's Guide to Everything gives the optional rule for "Going without a Long Rest" (emphasis added):
Going without a Long Rest.
A long rest is never mandatory, but going without sleep does have its consequences. If you want to account for the effects of sleep deprivation on characters and creatures, use these rules.
Whenever you end a 24-hour period without finishing a long rest, you must succeed on a DC 10 Constitution saving throw or suffer one level of exhaustion.
It becomes harder to fight off exhaustion if you stay awake for multiple days. After the first 24 hours, the DC increases by 5 for each consecutive 24-hour period without a long rest. The DC resets to 10 when you finish a long rest.
And the PHB specifies a Long Rest as:
Long Rest
A long rest is a period of extended downtime, at least 8 hours long, during which a character sleeps for at least 6 hours and performs no more than 2 hours of light activity, such as reading, talking, eating, or standing watch.
If a character has a feature such that they don't need to sleep, do these rules affect them? Would they still have to stave off exhaustion (and make those Constitution saving throws) if they don't sleep?