cargo / tempfile
tempfile
What changed in tempfile 2 to 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
1 breaking1 deprecations2 new APIs and options3 behavior and defaults1 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli inittempfile 36 changes
Deprecations 1
Deprecates TempPath::from_path in favor of the new TempPath::try_from_path method.
New APIs and options 1
Adds a method that behaves like TempPath::from_path but returns an error if converting a relative path to an absolute path fails or the path is empty.
Behavior and default changes 3
Now attempts to convert relative paths to absolute paths; if conversion fails, it keeps the relative path.
tempfile now supports getrandom 0.4.x while retaining support for getrandom 0.3.x, allowing projects to resolve either version.
WASIp2 is now fully supported without nightly features or additional feature flags.
Fixes and other changes 1
NamedTempFile::persist is now supported on RedoxOS.
tempfile 22 changes
Breaking changes 1
Replaces TempFile with a function that returns std::fs::File objects, which are more useful because most Rust libraries expect normal File objects.
New APIs and options 1
Adds a method to NamedTempFile to continue supporting shared temporary files.