-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Description
In PR #27619 which updates rustc, a test failure shows that the truetype
has code that calls std::mem::zeroed
for at least one struct that contains a Vec
.
This is Undefined Behavior, and newer Rust versions prevent it by panicking at runtime.
Unfortunately this problem is still present in the latest git commit for that crate, which is from 2017. Fixing it is likely possible but not trivial. Since we only use this crate in components/gfx/platform/windows/font.rs
it might be easier to migrate to another crate that doesn’t have this problem. There exist several that can parse Truetype files. stb_truetype
is already in our Cargo.lock
(though I don’t know if we actually build it in typical configs, it might be behind a feature flag of an intermediate dependency). ttf-parser
is under active maintenance.