Revert "merge 0.40.0"

This reverts commit c71761cd8cda84294f3a295bfaf7551c43585f2f, reversing
changes made to 4d3e3d989cb46db988fc9ad543884c36ed49bb35.