Revert "Synced with 3.0 upstream branch (differs from master)"

This reverts commit fc940d7c44254e6401b36b32ed936b1dfb975c8a, reversing
changes made to 296c871b93b76cbc84d8a02b27074e6fcb9497e8.