Backport to the Rust version used in Servo.