[stdlib] Unify init pointee methods by Julian-J-S · Pull Request #6355 · modular/modular

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