unstale

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 init

@unstale/cli on npm

tempfile 36 changes

Deprecations 1

  • Deprecates TempPath::from_path in favor of the new TempPath::try_from_path method.

    3.27.0release notes

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.

    3.27.0release notes

Behavior and default changes 3

  • Now attempts to convert relative paths to absolute paths; if conversion fails, it keeps the relative path.

    3.27.0release notes

  • tempfile now supports getrandom 0.4.x while retaining support for getrandom 0.3.x, allowing projects to resolve either version.

    3.25.0release notes

  • WASIp2 is now fully supported without nightly features or additional feature flags.

    3.24.0release notes

Fixes and other changes 1

  • NamedTempFile::persist is now supported on RedoxOS.

    3.26.0release notes

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.

    2.0.0release notes

New APIs and options 1

  • Adds a method to NamedTempFile to continue supporting shared temporary files.

    2.0.0release notes