Skip to main content


Content warning: Rust question

#rust

reshared this

in reply to Jonathan Lamothe

Content warning: Rust question

in reply to Devon Morris

Content warning: Rust question

in reply to Mo :ferris: :tux:

@mo8it My bet is that it's being called on a Unix-like OS while the process is multi-threaded. Returning the error is necessary for soundness.
in reply to Jacob Pratt

@Jacob Pratt You are correct, though this behaviour is surprising to me. I am still very much a Rust newbie. Can you elaborate on what makes getting the local UtcOffset not threadsafe in such an environment?
in reply to Jonathan Lamothe

Sorry, didn't get the ping.

Basically, environment variables are inherently thread-unsafe per the POSIX standard. Some operating systems voluntarily provide thread-safe implementations, and those OS's are exempted from the check. It's not anything Rust specific.

in reply to Jacob Pratt

@Jacob Pratt Good to know. In the meantime, I've worked around the issue by allowing a UtcOffset to be manually specified.

This website uses cookies. If you continue browsing this website, you agree to the usage of cookies.