Mirroring #15806.