Ownership guide

This is a work in progress, but this should get *extensive* review, so I'm putting it up early and often.

This is the start of a draft of the new 'ownership guide,' which explains ownership, borrowing, etc. I'm feeling better about this framing than last time's, but we'll see.
Another idea to help newbies is to include a guide on specific error
messages, or at least include it in the document so it turns up on google
search.

On Thu, Nov 6, 2014 at 3:32 PM, Peter N <notifications@github.com> wrote:

> In src/doc/guide-ownership.md:
>
> > +This function takes ownership, because it takes a `Box`, which
> > +owns its contents. But then we give ownership right back.
> > +
> > +In the physical world, you can give one of your possessions to
> > +someone for a short period of time. You still own your
> > +posession, you're just letting someone else use it for a
> > +while. We call that 'lending' something to someone, and that
> > +person is said to be 'borrowing' that something from you.
> > +
> > +Rust's ownershp system also allows an owner to lend out a
> > +handle for a limited period. This is also called 'borrowing.'
> > +Here's a version of `add_one` which borrows its argument
> > +rather than taking ownership:
> > +
> > +```rust
> > +fn add_one(num: &int) -> int {
>
> [image: :+1:] to this suggestion - or to linking to variations on
> non-trivial examples that will nevertheless constitute a significant
> stumbling block while trying to do common operations.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/rust-lang/rust/pull/18613/files#r19984737>.
>



-- 
The fruit of silence is prayer;
the fruit of prayer is faith;
the fruit of faith is love;
the fruit of love is service;
the fruit of service is peace.  -- Mother Teresa