Skip to content

Add std::chrono::time_point constructor overloads and tests - #50

Merged
teor2345 merged 17 commits into
rustfoundation:mainfrom
yalagadapavankumar:constructor-overloading
Nov 6, 2026
Merged

teor2345 merged 17 commits into
rustfoundation:mainfrom
yalagadapavankumar:constructor-overloading

Conversation

@yalagadapavankumar

@yalagadapavankumar yalagadapavankumar commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Add C++ std::chrono::time_point constructors in Rust using overload! macro.

  • Default constructor: Creates time point at the clock's epoch.
  • Constructor from milliseconds: Creates time point from duration in milliseconds.
  • Converting constructor: Creates time point from another time point that uses seconds.
  1. Write Rust wrappers for that C++ type, for 3-5 different overloaded method names:
    • Create a new file named after your type in overloading-macros/cpp-overload-test/src/stdcpp
    • Wrap constructors first, writing tests to make sure the correct constructor is called
    • Explain any potential compatibility issues in a Limitations doc section
    • Explain usability issues in an Ergonomics doc section
    • Check that you have implemented all the overloads for each method name, or documented why you can't
    • Push your changes and wait for a review
  2. Add a separate example with some failing overloads
    • Create a new file named after your type in overloading-macros/cpp-overload-test/examples
    • Wrap accessor/modifier methods
    • Explain how they fail in an Incompatibilities doc section
    • Explain how the overload failures could be resolved in a Workarounds doc section
    • Optional: If there's a C++ feature with no equivalent in Rust, explain that in an Inexpressible Overloads doc section
    • Push your changes and wait for a review
  3. Update the overload macro compatibility table Markdown doc
    • If you haven't checked some kinds of overloads, put a ?in those squares
    • Push your changes and wait for a review

teor2345

This comment was marked as resolved.

@yalagadapavankumar

This comment was marked as resolved.

@teor2345

This comment was marked as resolved.

@yalagadapavankumar

This comment was marked as resolved.

@yalagadapavankumar

This comment was marked as resolved.

@teor2345

Copy link
Copy Markdown
Collaborator

for the October round, and as far as I can see, they lead to the October channels.

this is the link representing as text which is not for October channel, which is exits in all 3 rust projects, for this project Extend Rust stdlib custom allocator support, they didn't provide zulip properly, so people believe this text is zulip channel for this project.

This is now fixed, and if people accidentally introduce themselves somewhere else, someone from the community will move their post to the right channel.

teor2345

This comment was marked as resolved.

@yalagadapavankumar

This comment was marked as resolved.

@yalagadapavankumar

This comment was marked as resolved.

@teor2345 teor2345 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there, just need to tweak it to match the C++ overloads a bit more closely.

@teor2345 teor2345 added the outreachy Tasks for outreachy applicants label Oct 27, 2026

@teor2345 teor2345 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks good, let's move on to stage 2 of this task, using the instructions in the PR description.

Please create a new file with examples of failing overloads, the instructions for creating the stderr file are here:

# Or just do `cargo build --package cpp-overload-test --example NAME > cpp-overload-test/examples/NAME.stderr 2>&1`
# and delete the cargo Updating/Download*/Compiling logs.

@teor2345

Copy link
Copy Markdown
Collaborator

Just a reminder to move on to steps 2 & 3 in the PR description, and make sure they are up to date with your latest code changes.

Applications must be submitted to Outreachy by Monday 9 November, please include this PR and any other Rust PRs you've done in that time.

@teor2345 teor2345 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is mostly fine, just need to do code formatting.

Please move on to step 3, summarising the results of the analysis.

@teor2345 teor2345 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just need to fix a few things, let me know if you need help with this

Comment thread cpp-overloads-in-rust.md Resolved
Comment thread cpp-overloads-in-rust.md Resolved
Co-authored-by: teor <teor@riseup.net>

@teor2345 teor2345 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just going to tweak the whitespace here, then merge

Comment thread cpp-overloads-in-rust.md Resolved
Comment thread cpp-overloads-in-rust.md Resolved
@teor2345
teor2345 merged commit 43c35b2 into rustfoundation:main Nov 6, 2026
13 checks passed
@teor2345

teor2345 commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Just reminding you that the Outreachy final application deadline is this Monday 9 November. You can include any Rust PR or ticket work you've done, it doesn't have to be merged (or reviewed) yet.

Please submit a final application on the Outreachy website before Monday. The exact deadline is 4pm UTC, but it is better to submit early. You can edit your submitted application up until the deadline (and you can keep working on PRs after the deadline).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

outreachy Tasks for outreachy applicants

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants