Skip to content

Commit 5f1bc4a

Browse files
committed
---
yaml --- r: 2156 b: refs/heads/master c: b7d680b h: refs/heads/master v: v3
1 parent 958bd6c commit 5f1bc4a

File tree

2 files changed

+12
-26
lines changed

2 files changed

+12
-26
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: d2bd07dcb02783063375b6c8532fceaf9fa9d50f
2+
refs/heads/master: b7d680b57d941bbcb8e11363f6278852d59eaea9

trunk/doc/rust.texi

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -321,11 +321,9 @@ coupled to the loop that invoked it.
321321
@item Direct interface to C code
322322

323323
Rust can load and call many C library functions simply by declaring
324-
them. Calling a C function statically marks a function as ``unsafe'', unless
325-
the task calling the unsafe function is further isolated within an external
326-
``heavyweight'' operating-system subprocess. Every ``unsafe'' function or
327-
module in a Rust compilation unit must be explicitly authorized in the crate
328-
file.
324+
them. Calling a C function is an ``unsafe'' action, and can only be taken
325+
within a block marked with the @code{unsafe} keyword. Every unsafe block
326+
in a Rust compilation unit must be explicitly authorized in the crate file.
329327

330328
@sp 1
331329
@item Structural algebraic data types
@@ -684,7 +682,6 @@ The keywords are:
684682
@tab @code{const}
685683
@tab @code{thread}
686684
@item @code{auth}
687-
@tab @code{impure}
688685
@tab @code{unsafe}
689686
@tab @code{self}
690687
@item @code{bind}
@@ -1490,7 +1487,7 @@ operating-system processes.
14901487
@cindex Send expression
14911488
@cindex Receive expression
14921489

1493-
With the exception of @emph{unsafe} constructs, Rust tasks are isolated from
1490+
With the exception of @emph{unsafe} blocks, Rust tasks are isolated from
14941491
interfering with one another's memory directly. Instead of manipulating shared
14951492
storage, Rust tasks communicate with one another using a typed, asynchronous,
14961493
simplex message-passing system.
@@ -1788,7 +1785,6 @@ fn main() @{
17881785
@c * Ref.Item.Fn:: Items defining functions.
17891786
@cindex Functions
17901787
@cindex Slots, function input and output
1791-
@cindex Effect of a function
17921788
@cindex Predicate
17931789

17941790

@@ -1809,10 +1805,6 @@ expression. If a control path lacks a @code{ret} expression in source code, an
18091805
implicit @code{ret} expression is appended to the end of the control path
18101806
during compilation, returning the implicit @code{()} value.
18111807

1812-
A function may have an @emph{effect}, which may be either @code{impure} or
1813-
@code{unsafe}. If no effect is specified, the function is said to be
1814-
@dfn{pure}.
1815-
18161808
Any pure boolean function is also called a @emph{predicate}, and may be used
18171809
as part of the static typestate system. @xref{Ref.Typestate.Constr}.
18181810

@@ -2307,8 +2299,8 @@ by named reference to a @emph{tag item} declaration. @xref{Ref.Item.Tag}.
23072299

23082300
The function type-constructor @code{fn} forms new function types. A function
23092301
type consists of a sequence of input slots, an optional set of input
2310-
constraints (@pxref{Ref.Typestate.Constr}), an output slot, and an
2311-
@emph{effect}. @xref{Ref.Item.Fn}.
2302+
constraints (@pxref{Ref.Typestate.Constr}) and an output
2303+
slot. @xref{Ref.Item.Fn}.
23122304

23132305
An example of a @code{fn} type:
23142306
@example
@@ -2329,7 +2321,7 @@ x = bo(5,7);
23292321

23302322
The iterator type-constructor @code{iter} forms new iterator types. An
23312323
iterator type consists a sequence of input slots, an optional set of input
2332-
constraints, an output slot, and an @emph{effect}. @xref{Ref.Item.Iter}.
2324+
constraints and an output slot. @xref{Ref.Item.Iter}.
23332325

23342326
An example of an @code{iter} type:
23352327
@example
@@ -2449,9 +2441,7 @@ that a variety of particular objects may conform to, by supporting a superset
24492441
of the methods.
24502442

24512443
An object type that can contain fields of a given layer must be declared as
2452-
residing in that layer (or lower), like any other type. And similarly a method
2453-
with a given effect must be declared as having that effect (or lower) in the
2454-
object type, like any other function.
2444+
residing in that layer (or lower), like any other type.
24552445

24562446
An example of an object type with two separate object items supporting it, and
24572447
a client function using both items via the object type:
@@ -2460,17 +2450,17 @@ a client function using both items via the object type:
24602450
24612451
state type taker =
24622452
state obj @{
2463-
impure fn take(int);
2453+
fn take(int);
24642454
@};
24652455
24662456
state obj adder(mutable int x) @{
2467-
impure fn take(int y) @{
2457+
fn take(int y) @{
24682458
x += y;
24692459
@}
24702460
@}
24712461
24722462
obj sender(chan[int] c) @{
2473-
impure fn take(int z) @{
2463+
fn take(int z) @{
24742464
c <| z;
24752465
@}
24762466
@}
@@ -3191,10 +3181,6 @@ by the runtime or emitted to a system console. Log expressions are enabled or
31913181
disabled dynamically at run-time on a per-task and per-item
31923182
basis. @xref{Ref.Run.Log}.
31933183

3194-
Executing a @code{log} expression is not considered an impure effect in the
3195-
effect system. In other words, a pure function remains pure even if it
3196-
contains a log expression.
3197-
31983184
@example
31993185
@end example
32003186

0 commit comments

Comments
 (0)