Skip to content

Commit a45bc6d

Browse files
committed
---
yaml --- r: 38573 b: refs/heads/incoming c: d471e24 h: refs/heads/master i: 38571: 15a665e v: v3
1 parent 544b286 commit a45bc6d

File tree

2 files changed

+3
-21
lines changed

2 files changed

+3
-21
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
9-
refs/heads/incoming: 70909533f09a6d187b7728f970a64c448c79290c
9+
refs/heads/incoming: d471e2421411d86a56d88bfc3ed78b391b8b809f
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/doc/rust.md

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2870,16 +2870,12 @@ references to any boxes; the remainder of its heap is immediately freed.
28702870

28712871
A task's stack contains slots.
28722872

2873-
A _slot_ is a component of a stack frame. A slot is either a *local variable*
2874-
or a *reference*.
2873+
A _slot_ is a component of a stack frame, either a function parameter,
2874+
a [temporary](#lvalues-rvalues-and-temporaries), or a local variable.
28752875

28762876
A _local variable_ (or *stack-local* allocation) holds a value directly,
28772877
allocated within the stack's memory. The value is a part of the stack frame.
28782878

2879-
A _reference_ references a value outside the frame. It may refer to a
2880-
value allocated in another frame *or* a boxed value in the heap. The
2881-
reference-formation rules ensure that the referent will outlive the reference.
2882-
28832879
Local variables are immutable unless declared with `let mut`. The
28842880
`mut` keyword applies to all local variables declared within that
28852881
declaration (so `let mut x, y` declares two mutable variables, `x` and
@@ -2891,20 +2887,6 @@ state. Subsequent statements within a function may or may not initialize the
28912887
local variables. Local variables can be used only after they have been
28922888
initialized; this is enforced by the compiler.
28932889

2894-
References are created for function arguments. If the compiler can not prove
2895-
that the referred-to value will outlive the reference, it will try to set
2896-
aside a copy of that value to refer to. If this is not semantically safe (for
2897-
example, if the referred-to value contains mutable fields), it will reject the
2898-
program. If the compiler deems copying the value expensive, it will warn.
2899-
2900-
A function with an argument of type `&mut T`, for some type `T`, can write to
2901-
the slot that its argument refers to. An example of such a function is:
2902-
2903-
~~~~~~~~
2904-
fn incr(i: &mut int) {
2905-
*i = *i + 1;
2906-
}
2907-
~~~~~~~~
29082890

29092891
### Memory boxes
29102892

0 commit comments

Comments
 (0)