Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document status of local-offset support #687

Closed
Aeledfyr opened this issue Jun 9, 2024 · 2 comments
Closed

Document status of local-offset support #687

Aeledfyr opened this issue Jun 9, 2024 · 2 comments
Labels
A-docs Area: documentation

Comments

@Aeledfyr
Copy link

Aeledfyr commented Jun 9, 2024

As of time 0.3.36, any method that requires the system's local offset will fail on multithreaded unix-like systems, but this is not mentioned in the documentation for the local-offset feature, or any of the relevant methods.

Places where this should hopefully be documented:

  • The description of the local-offset feature
  • The documentation for time::UtcOffset::local_offset_at and time::UtcOffset::current_local_offset
  • The documentation for time::OffsetDateTime::now_local

#297 gives a good description of this problem; it was closed after adding documentation in 288c942.

However, this documentation was removed in b513927, and replaced with "Without [unsound_local_offset], any method that requires the local offset will return the Err variant." in the crate-level documentation.

Later, 110e17b fully removed the reference to the local offset methods failing by default.

At this point, there is no documentation of the default behavior in places where people would look -- in the documentation of the local-offset feature or in the documentation of the methods that will fail, leading to a large number of issues asking about it: #591 #457 #297 #617 #538 #427 #645

I'm open to making a PR to add documentation, but it'll likely need to be carefully phrased.

@jhpratt
Copy link
Member

jhpratt commented Jun 10, 2024

This may be changing in the near future. Mutating the environment is unsafe starting in the 2024 edition (due to be released in October), and I expect that the associated lint will be warn-by-default (if not force-warn) in all editions ≤2021 soon. If and when that happens, I will revisit the issue to see if it remains an issue.

Given the inherent lack of a stability promise and the fact that it may change relatively soon, I think it would be best to not document it at this time. My comment here remains my position.

@jhpratt jhpratt closed this as not planned Won't fix, can't repro, duplicate, stale Jun 10, 2024
@jhpratt jhpratt added the A-docs Area: documentation label Jun 10, 2024
@JensMertelmeyer

This comment has been minimized.

@time-rs time-rs locked and limited conversation to collaborators Aug 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-docs Area: documentation
Projects
None yet
Development

No branches or pull requests

3 participants