Skip to content

[stdlib] Unify init pointee methods#6355

Open
Julian-J-S wants to merge 3 commits intomodular:mainfrom
Julian-J-S:refactor/unify-init-pointee-methods
Open

[stdlib] Unify init pointee methods#6355
Julian-J-S wants to merge 3 commits intomodular:mainfrom
Julian-J-S:refactor/unify-init-pointee-methods

Conversation

@Julian-J-S
Copy link
Copy Markdown
Contributor

Summary

Unify init_pointee methods from:

  • init_pointee_copy
  • init_pointee_move

to only:

  • init_pointee

with arguments copy and take to align with the "init-unification".

Actual method changes in:

  • mojo/stdlib/std/memory/unsafe_pointer.mojo
  • mojo/stdlib/std/memory/_nonnull.mojo

Rest is adjusting to the new name in stdlib, docs, mdx and changelog.

Assisted-by: AI

Testing

As I am fairly new to the repo I am not sure which tests ideally to run. The following were run and passed.

./bazelw test //mojo/stdlib/test/memory/unsafe_pointer:test_unsafe_pointer_v2.mojo.test //mojo/stdlib/test/memory:test_span.mojo.test //mojo/stdlib/test/memory:test_memory.mojo.test //mojo/stdlib/test/memory:test_owned_pointer.mojo.test //mojo/stdlib/test/memory/unsafe_pointer/compile_fail:lit_tests
./bazelw test //mojo/stdlib/test/collections:test_list.mojo.test //mojo/stdlib/test/utils:test_variant.mojo.test //mojo/stdlib/test/iter:test_ref_iteration.mojo.test

@Julian-J-S Julian-J-S requested review from a team as code owners April 5, 2026 18:34
@github-actions github-actions bot added mojo-stdlib Tag for issues related to standard library waiting-on-review mojo-docs labels Apr 5, 2026
@soraros
Copy link
Copy Markdown
Contributor

soraros commented Apr 6, 2026

CC @NathanSWard.

@NathanSWard NathanSWard self-assigned this Apr 6, 2026
Copy link
Copy Markdown
Contributor

@NathanSWard NathanSWard left a comment

Choose a reason for hiding this comment

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

Thanks for this!
Apologies on being a bit slow to review. I left some comments!

Once you address them and if you can rebase on main, I should be able to pull and get this merged internally!

Comment thread mojo/docs/changelog/v0.24.1.md Outdated
Comment thread mojo/stdlib/std/memory/unsafe_pointer.mojo Outdated
Comment thread mojo/stdlib/std/memory/unsafe_pointer.mojo
@Julian-J-S Julian-J-S force-pushed the refactor/unify-init-pointee-methods branch from a66ea5c to 7f984c5 Compare April 12, 2026 20:21
@Julian-J-S
Copy link
Copy Markdown
Contributor Author

Thanks for this! Apologies on being a bit slow to review. I left some comments!

Once you address them and if you can rebase on main, I should be able to pull and get this merged internally!

  • Resolved all comments (hopefully)
  • rebased on main

Let my know if there is anything else 😉

@NathanSWard
Copy link
Copy Markdown
Contributor

haha sorry again... if you can rebase once more I'll be on top of syncing. There's been a lot of churn in the stdlib recently so merge conflicts pop up too fast I can't keep up 😢

@Julian-J-S Julian-J-S force-pushed the refactor/unify-init-pointee-methods branch from 569a0e8 to 3a5b60f Compare April 19, 2026 06:55
@Julian-J-S Julian-J-S force-pushed the refactor/unify-init-pointee-methods branch from 3a5b60f to 2e51c7d Compare April 19, 2026 06:59
@Julian-J-S
Copy link
Copy Markdown
Contributor Author

haha sorry again... if you can rebase once more I'll be on top of syncing. There's been a lot of churn in the stdlib recently so merge conflicts pop up too fast I can't keep up 😢

haha no problem; just the downsides of very rapid development pace 🤓

Let's try again!
I can see 2 tests failing but they seem unrelated 🤔

@JoeLoser
Copy link
Copy Markdown
Member

!sync

@modularbot modularbot added the imported-internally Signals that a given pull request has been imported internally. label Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

imported-internally Signals that a given pull request has been imported internally. mojo-docs mojo-stdlib Tag for issues related to standard library waiting-on-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants