Updated with copy of changes in https://github.com/mozilla/rust/pull/11230