Skip to content

Having two UNIX_EPOCH constants is a potential source of confusion #52519

Closed
@ssokolow

Description

@ssokolow

While trying to get comfortable with SystemTime, I found myself extremely confused because it appeared that UNIX_EPOCH was usable, despite being marked unstable.

It wasn't until I checked bug #49502 that I finally realized what I'd repeatedly overlooked: What was being successfully used was std::time::UNIX_EPOCH rather than std::time::SystemTime::UNIX_EPOCH.

The simplest way to head off this kind of confusion would be to have the documentation for the two UNIX_EPOCH definitions mention each other's existence.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions