# "out" function arguments?

**URL:** <https://internals.rust-lang.org/t/out-function-arguments/8563>\
**Category:** Uncategorized\
**Created:** [October 15, 2018, 11:59am UTC](https://internals.rust-lang.org/t/out-function-arguments/8563 "2018-10-15T11:59:34Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Ixrec](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/ixrec/32/6754_2.png) [@Ixrec](https://internals.rust-lang.org/u/Ixrec)\
**Post date:** [October 15, 2018, 1:45pm UTC](https://internals.rust-lang.org/t/out-function-arguments/8563/3 "2018-10-15T13:45:12Z")

</div>

A few discussions on out/uninit references that are arguably still active:

> <https://github.com/rust-lang/rfcs/pull/2534>
>
> Use \`&uninit T\` to initialize your memory directly!
> 
> This can have performance… improvements and makes dealing with uninitialized memory completely safe.
> 
> \[Rendered\](https://github.com/KrishnaSannasi/rfcs/blob/master/text/0000-write-pointers.md)
> 
> \---
> \*this RFC has been edited\* This RFC used to also have \`&out\`, but I removed them due to insufficient motivation, and a relatively easy workaround to \`&out\`.

> [@\[Pre-RFC\] Partially Initialized Types](https://internals.rust-lang.org/t/pre-rfc-partially-initialized-types/8402):
>
> there’s been a lot of talk about &uninit references, MaybeUninit, placement-new… I’d like to propose an alternative to all of them: Partially Initialized Types. They’re, arguably, the cleanest approach to all of this. Consider types: struct Foo { a: i32, b: i32 } struct Bar { a: i32, b: Foo } Then, we can have: let x: Bar(b(a)) = Bar { b: Foo { a: 1 } }; However, passing these to functions is mostly pointless: fn foo(x: &mut Bar()) { // can't do anything with x here } foo(x); // but c…

My impression is also that out/uninit references are lacking compelling motivation. In particular, `&mut MaybeUninit<T>` seems to cover a lot of the same use cases.

The discussion on that RFC I linked above left me with a vague impression that `&out/&uninit` don't have any advantages over `&mut MaybeUninit<T>` after all, but I'm not entirely sure I understood it so cc @cramertj and @RustyYato

---

_[View the full topic](https://internals.rust-lang.org/t/out-function-arguments/8563)._
